html - First-child pseudo-class in css 2.1 -
i don't know put pseudo class in definition:
#recently_played_grid li img {     margin-left: 10px; } i want set margin-left 0px in first child of list. should do:
#recently_played_grid li:first-child img ?
it doesn't seem work
if looking have all images in first li item code should work fine. if looking have margin on first img child of every li you'll have change to
#recently_played_grid li img:first-child  <ul>     <li>         <img />                    << selects this, ,         <img />         <img />     </li>     <li>         <img />                     << selects this, ,         <img />         <img />     </li>     <li>         <img />                     << selects         <img />         <img />     </li> </ul> if want first img in first li should change to
#recently_played_grid li:first-child img:first-child   <ul>     <li>         <img />                          << selects         <img />         <img />     </li>     <li>         <img />         <img />         <img />     </li>     <li>         <img />         <img />         <img />     </li> </ul> further reading here http://www.w3.org/tr/css2/selector.html#pseudo-class-selectors
Comments
Post a Comment