Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Body tag margin=0 doesnt work in firefox
Old 03-19-2007, 11:26 PM Body tag margin=0 doesnt work in firefox
Skilled Talker

Posts: 52
Name: ana
Trades: 0
I want my site to start at the top of the page i.e.

body {
margin: 0px;
padding: 0px;
}

This works fine in IE (7), but not in any other browser?

This is my page: http://www.outer-edge.com.au/develop...ite/index.html

Help!
ana_rad is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-19-2007, 11:46 PM Re: Body tag margin=0 doesnt work in firefox
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
That works in both browsers, but I think it's the <table align="center"> that's throwing it off. FireFox is acting like you're using vAlign="center" although I think that only applies to a row, not the entire table.

But the table starts at pixel (0, 0), or owns space starting there. Try FireBug; it might help you track things down. I can't really figure it out, it looks like the table goes to the top of the page, but is part blank.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 03-19-2007, 11:47 PM Re: Body tag margin=0 doesnt work in firefox
Average Talker

Posts: 27
Name: Ross Dalangin
Trades: 0
use topmargin and leftmargin with value 0.
__________________

Please login or register to view this content. Registration is FREE
*
Please login or register to view this content. Registration is FREE
*
Please login or register to view this content. Registration is FREE
*
Please login or register to view this content. Registration is FREE
rossdalangin is offline
Reply With Quote
View Public Profile Visit rossdalangin's homepage!
 
Old 03-20-2007, 12:02 AM Re: Body tag margin=0 doesnt work in firefox
Skilled Talker

Posts: 52
Name: ana
Trades: 0
ive tried removing the center align within the table & topmargin and leftmargin with value 0 - and it still doesnt work
ana_rad is offline
Reply With Quote
View Public Profile
 
Old 03-20-2007, 01:03 AM Re: Body tag margin=0 doesnt work in firefox
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
The problem is that in this case, the table isn't necessary.

ana_rad, if you want your site to be a fixed width, then use a wrapper div. There's a lot less code, divs are vertically aligned to the top by default, and it loads faster.
Code:
#wrapper {
    margin:  0;
    padding:  0;
    width:  800px;
}
...
<body>
<div id="wrapper">
Your middle part
</div>
</body>
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-20-2007, 01:11 AM Re: Body tag margin=0 doesnt work in firefox
Skilled Talker

Posts: 52
Name: ana
Trades: 0
Thanks! That worked.

But now I have a horizontal scroll at the base of the screen.
ana_rad is offline
Reply With Quote
View Public Profile
 
Old 03-20-2007, 01:14 AM Re: Body tag margin=0 doesnt work in firefox
Skilled Talker

Posts: 52
Name: ana
Trades: 0
never mind I worked it out

it was my menu that was pushing it across...
ana_rad is offline
Reply With Quote
View Public Profile
 
Old 03-20-2007, 01:17 AM Re: Body tag margin=0 doesnt work in firefox
Skilled Talker

Posts: 52
Name: ana
Trades: 0
Now i just realised that it doesnt work correctly in IE 6. It works in all other browsers!

See here: http://www.outer-edge.com.au/develop...ite/index.html
ana_rad is offline
Reply With Quote
View Public Profile
 
Old 03-20-2007, 01:27 AM Re: Body tag margin=0 doesnt work in firefox
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
You've got two divs with the "top" id. That could be your problem.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 03-20-2007, 02:10 AM Re: Body tag margin=0 doesnt work in firefox
Banned

Posts: 905
Name: Travel Agent
Trades: 0
Adam is correct -- here's what you currently have:

<div id="top">
<div id="top" class="menu">


Each div id must have a unique name, such as "top"; "middle"; "bottom"; etc.
travelagent is offline
Reply With Quote
View Public Profile
 
Old 03-20-2007, 02:38 PM Re: Body tag margin=0 doesnt work in firefox
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
Each div id must have a unique name, such as "top"; "middle"; "bottom"; etc.
Well.. only if you're going to use ID's Each div could have a class applied too.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 03-20-2007, 05:54 PM Re: Body tag margin=0 doesnt work in firefox
Skilled Talker

Posts: 52
Name: ana
Trades: 0
Oh I didnt realise that I had two same divs. oops.

Even though I removed that I still have the same problem in IE 6 :-(
ana_rad is offline
Reply With Quote
View Public Profile
 
Old 03-20-2007, 06:03 PM Re: Body tag margin=0 doesnt work in firefox
Skilled Talker

Posts: 52
Name: ana
Trades: 0
i fixed the problem. ignore this
ana_rad is offline
Reply With Quote
View Public Profile
 
Old 03-21-2007, 12:25 AM Re: Body tag margin=0 doesnt work in firefox
Banned

Posts: 905
Name: Travel Agent
Trades: 0
Quote:
Originally Posted by LadynRed View Post
Well.. only if you're going to use ID's Each div could have a class applied too.
Dang -- wish this keyboard would type what I'm saying out loud ... maybe I need a "talking puter" -- on 2nd thought, that might not work, as it would probably lock up on certain words...
travelagent is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Body tag margin=0 doesnt work in firefox
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.95168 seconds with 12 queries