Forum Moderators: not2easy

Message Too Old, No Replies

Setting a Different Top Margin on Main Page

Top Margin

         

tonto68

6:21 am on Jan 17, 2008 (gmt 0)

10+ Year Member



Hello, I am trying to set the main page of my site with a different margin than the other pages on my site (to accomodate a navigation bar which only appears on the main page). How can I go about doing this in the style.css? Thanks,

Robby

SuzyUK

9:18 am on Jan 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



add an ID to the body element of your main page HTML,
e.g
<body id="homepage">

then in your style.css

body {all regular rules in here including margin}

body#homepage {overriding margin rule in here}

if the element you want to change the margin on is not the body element, you can use that ID to specifically target any/all other elements on the homepage that might need a different look too

#homepage #contentdiv {..}