CSS selector for first element with class
Posted
by Rajat
on Stack Overflow
See other posts from Stack Overflow
or by Rajat
Published on 2010-04-26T22:51:13Z
Indexed on
2010/04/26
22:53 UTC
Read the original article
Hit count: 167
css
I have a bunch of elements with a classname
<p class="red"></p>
<div class="red"></div>
I cant seem to select the first element with the class="red" using the following CSS rule:
.red:first-child{
border:5px solid red;
}
What is wrong in this selector and how to correct it ??
© Stack Overflow or respective owner