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.

CSS Forum


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



Reply
Margins-Start At Top Of Browser or Other DIV?
Old 01-20-2008, 09:57 PM Margins-Start At Top Of Browser or Other DIV?
Novice Talker

Posts: 13
Name: C Mac
Trades: 0
Im trying to learn CSS.

Ive hit a roadblock. Im trying to get the ground work laid for my site, but am having diffifulty getting browsers to see my site the same. In IE, it seems as if a DIV "margin" starts at another margin. However, in Opera, a (top) "margin" starts at the top of the top of the page.

If that makes sence. Great.

If not. Here's the code. If you have opera... take a peek.

http://divingnutz.com/csstest.php

Quote:
<body>
<div id="menu">
<ul>
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Forum</a></li>
<li><a href="#">Photos</a></li>
<li><a href="#">Dive Sites</a></li>
<li><a href="#">News</a></li>
<li><a href="#"></a></li>
</ul>
</div>
<div id="header">
<h1>TESTING!!!!</h1>
</div>
</body>
Quote:
body {
background-image: url(header.jpg);
background-position: center top;
background-repeat: no-repeat;
background-color: #7AAEE2;
}
#menu {
width: 900px;
margin: 0 auto;
padding: 0px 0px 0px 0px;
position: static;
}

#menu ul {
margin: 0px 0px;
padding: 0px 0px;
list-style: none;
line-height: normal;
}

#menu li {
display: inline;
margin: 0px;
padding: 0px;
}

#menu a {
display: block;
float: left;
width: 149px;
height: 53px;
padding: 147.5px 0 0 0;
text-decoration: none;
text-align: center;
font-size: 28px;
color: #FFFFFF;
}
#menu a:hover {
color: #CCCCCC;
}

#menu .active a {
color: #E80732;
}
#header {
margin: 200px auto;
width: 900px;
background-color: #FFFFFF;

}
BubbaBob is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-21-2008, 01:28 AM Re: Margins-Start At Top Of Browser or Other DIV?
Arwen's Avatar
Experienced Talker

Posts: 39
Name: Arwen Taylor
Location: www.arwentaylor.com
Trades: 0
I'm not 100% certain but I think Opera is a browser that automatically adds like an 8px margin or padding if you don't define it in your css stylesheet. I noticed that on the #menu a that you have padding specified but not the margins. Try defining the margin property and see what happens.

Arwen
__________________

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

SEO Article and Content Writing Services. Drop by my
Please login or register to view this content. Registration is FREE
blog for tips, tools and advice on building a profitable online business.
Arwen is offline
Reply With Quote
View Public Profile Visit Arwen's homepage!
 
Old 01-21-2008, 11:54 AM Re: Margins-Start At Top Of Browser or Other DIV?
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Always, always zero out the default margins and padding in your CSS, this will level the playing field. You can do it like this:

* {margin: 0; padding: 0;}

Then you add margins and padding back in where YOU want them.
__________________
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 01-21-2008, 01:26 PM Re: Margins-Start At Top Of Browser or Other DIV?
Novice Talker

Posts: 13
Name: C Mac
Trades: 0
Ok, defining the margins cleared up one problem I was having. However, Opera still starts the top margin at the top of the page, and IE starts below the other DIV. (or so it seems, but like I said im new at this.)

I Attatched a screen shot from Opera. Just a tad different from IE


Thanks Yall
Attached Images
File Type: jpg cssopera.JPG (38.2 KB, 4 views)
BubbaBob is offline
Reply With Quote
View Public Profile
 
Old 01-21-2008, 01:55 PM Re: Margins-Start At Top Of Browser or Other DIV?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
remove the position:static from #menu
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-21-2008, 02:32 PM Re: Margins-Start At Top Of Browser or Other DIV?
Novice Talker

Posts: 13
Name: C Mac
Trades: 0
Quote:
Originally Posted by chrishirst View Post
remove the position:static from #menu
DOH!

Thank You! That did the trick.
BubbaBob is offline
Reply With Quote
View Public Profile
 
Old 01-24-2008, 01:11 AM Re: Margins-Start At Top Of Browser or Other DIV?
Novice Talker

Posts: 4
Trades: 0
float nearly everything is the way
mediarefined is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Margins-Start At Top Of Browser or Other DIV?
 

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