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
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
 
When You Register, These Ads Go Away!
     
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,024
Name: Forrest Croce
Location: Seattle, WA
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.
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
use topmargin and leftmargin with value 0.
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
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,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
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>
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
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
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
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,945
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
You've got two divs with the "top" id. That could be your problem.
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: 907
Name: Travel Agent
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
Super Moderator

Posts: 6,406
Location: Tennessee
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 !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
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
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
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: 907
Name: Travel Agent
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

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

vB 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.16943 seconds with 13 queries