This is called as CSS3 :last-child Selector
This Will select last html element in certain css class.
As an example think your php application will echo you nth number of div in php page.
Some times it may be 10 divs/ 5 divs or only 3 divs. But they may draw automatically in some scenarios. If you want to high light final div of them with special background color you can use CSS3 :last-child Selector to do that.
Specify a background color for the <p> element that is the last child of its parent:
div:last-child {
background: #0000ff;
}
Result will like
The first paragraph.
The second paragraph.
The third paragraph.
The fourth paragraph.
0 comments:
Post a Comment