Results 1 to 2 of 2

Thread: How to use 2 ID CSS selectors in a rule

  1. #1
    Join Date
    Apr 2009
    Location
    Sydney, Australia
    Posts
    110
    Thanks
    15
    Thanked 1 Time in 1 Post

    Default How to use 2 ID CSS selectors in a rule

    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
    Code:
    <div id="header_index"> 
      <div id="logo">
      </div>
    </div>
    On the other it looks like this...
    Code:
    <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.

    Code:
    #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;
    		
    	}

  2. #2
    Join Date
    Apr 2009
    Location
    Sydney, Australia
    Posts
    110
    Thanks
    15
    Thanked 1 Time in 1 Post

    Default

    Ok. Silly me.

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

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •