last-child Selector

last-child Selector
CSS last-child Selector reference
The CSS last-child structural pseudo-class selector ( X:last-child { } ) is used to target and style the last child of its parent element.
CSS CODE EXAMPLE
<!DOCTYPE html>
<style type="text/css">
#mydiv p:last-child {
    color:#F0F;
    font-weight:bold;
}
</style>
<div id="mydiv">
  <p>Paragraph content...</p>
  <p>Paragraph content...</p>
  <p>Paragraph content...</p>
  <p>Paragraph content...</p>
</div>
Paragraph content...
Paragraph content...
Paragraph content...
Paragraph content...

Related Posts :

  • overflow-x overflow-x CSS overflow-x Property The CSS overflow-x property is used to speci… Read More...
  • z-index z-index CSS z-index Property The CSS z-index property is used to layer elements… Read More...
  • visibility visibility CSS visibility Property The CSS visibility property is used to hide … Read More...
  • top top CSS top Property The CSS top property is used to offset an element's top po… Read More...
  • overflow-y overflow-y CSS overflow-y Property The CSS overflow-y property is used to speci… Read More...

0 Response to "last-child Selector"

Post a Comment