The Artima Developer Community
Sponsored Link

Web Buzz Forum
CSS :first-child - Definition and Usage

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Lee v

Posts: 403
Nickname: a1plus19
Registered: Apr, 2011

Lee - helping out tech stuff.
CSS :first-child - Definition and Usage Posted: May 30, 2011 11:53 AM
Reply to this message Reply

This post originated from an RSS feed registered with Web Buzz by Lee v.
Original Post: CSS :first-child - Definition and Usage
Feed Title: IT Jungles
Feed URL: http://www.itjungles.com/rss
Feed Description: Learn all tech stuff at ITJungles.com
Latest Web Buzz Posts
Latest Web Buzz Posts by Lee v
Latest Posts From IT Jungles

Advertisement

The :first-child selector is used to select the specified selector, only if it is the first child of its parent.

Example:

- Select and style the first child element of every <ul> element:

ul>:first-child { background:#A40003; }

- Select and style the first <li> element in lists:

li:first-child {background:#000;}

- Select and style every <p> element that is the first child of its parent:

p:first-child { background-color:#999;}

The :first-child selector is supported in all major browsers.

Note: For :first-child to work in IE8 and earlier, a <!DOCTYPE> must be declared.

Did you like this tip? {fblike}

Read: CSS :first-child - Definition and Usage

Topic: Free Open Source Barcode & QR Code Writer for Windows, Mac & Linux Previous Topic   Next Topic Topic: Security Analyzer 2.0 Helps Determine The Current Security Status

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use