Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set css for last div layer based on its class

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
0
0
US
I have something like this

Code:
<div style="with: 100%;">
  <div class="tab">AAAA</div>
  <div class="tab">BBBB</div>
  <div class="tab">BBBB</div>
</div>

in the css I have
Code:
.tab {
background: #eee;
color: #000;
border-color: #000;
border: 1px double #000033;
border-width: 1px 0px 1px 1px;
...
}

the DIVs are rendered dynamically and I am looking for CSS to set the right border for the last rendered DIV to set the right border. I've tried

Code:
.tab:last-child { border-right: 1px double #000033; }

and/or

div.tab:last-child

[code]

I cannot get it to work.  What am I doing or must do to get this to work without having to do it within the server side script?

Thank you all in advance for your assistance!


--
SouthBeach
[URL unfurl="true"]http://www.fp2php.com[/URL]
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
@feherke, Thanks for taking the time to check on it and putting up the dabblet snippet.

@audiopro, Yes, I meant width - I typed the above off the top of my head, it was not cut/paste.

Thank you guys!



--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top