Log in

View Full Version : How to use 2 ID CSS selectors in a rule



sniperman
08-18-2011, 01:17 PM
I need to brush up on my CSS. I have a website powered by PHP which uses 2 templates.

The website is here http://insurancerestorationgroup.com.au/

The code on one page looks like this

<div id="header_index">
<div id="logo">
</div>
</div>

On the other it looks like this...

<div id="header">
<div id="logo">
</div>
</div>

I am trying to absolutely position the logo in different locations for each template to clear the header... but for some reason I cant use an ID selector beside an ID selector... here are my CSS rules.


#top_box_index {

margin: 405px 0 30px 0;
z-index: 5;

}

#header_index #top_box_index {

margin: 405px 0 30px 0;
z-index: 5;

}

#header #top_box_index {

margin: 245px 0 30px 0;
z-index: 5;

}

#logo {

float: left;
position:absolute;
top:550px;
left:-240px;

}

sniperman
08-18-2011, 01:48 PM
Ok. Silly me.

#header #logo { }
#header_index #logo {}

I find theme editors hard to scroll in, hence, the wrong selectors in the first place!