dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] Having problems with :last-child

  1. #1
    Join Date
    Sep 2009
    Posts
    72

    resolved [RESOLVED] Having problems with :last-child

    I can't get this code to work correctly in any browser:

    HTML Code:
    .boxes-wrapper{
        width:960px;
      }
      .section_box{
        width:311px;
        margin:0 10px 10px 0;
        height:200px;
    	  background:#f3f3f3;
    	  float:left;
      }
      
      .boxes-wrapper .section_box:last-child{
        margin:0;
        background:#000;
      }
    
    <div class="boxes-wrapper">       
                       
      <div class="section_box">
        
      </div>
      
      <div class="section_box">
        
      </div>
      
      <div class="section_box">
        
      </div>
      <div class="clear"></div> 
             
    </div>     
    The last "section_box" never changes color...

    What am I doing wrong?

    Thanks in advanced for your time and help.

  2. #2
    Join Date
    Sep 2009
    Posts
    72
    I fixed it using nth-child....

    Thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles