Open minds leads to freedom

Communicating my thoughts on software development

About CSS2 Selectors

Posted by rnaufal on May 1st, 2008

Some days ago I was trying to customize my blog’s look and feel to remove my pic from each one of my entries.
At my blog’s theme, every <img> tag (which contains my pic for each entry) is the first child of a <td> tag.
I discovered a very handy CSS2 selector syntax to accomplish this task:

E:first-child: Matches element E when E is the firstchild of its parent (The :first-child pseudo-class)

So, the custom CSS ended up being td > img:first-child {display: none;}, which removes my user pic from every post, but keep the one on the left sidebar.

Just now you are seeing only one pic of mine :-)

Share and Enjoy:
  • Twitter
  • Digg
  • del.icio.us
  • Reddit
  • Facebook
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • FriendFeed
  • Google Buzz
  • MySpace
  • Slashdot
  • http://bpfurtado.livejournal.com/ bpfurtado

    Nice tip :)

  • http://bpfurtado.livejournal.com/ bpfurtado

    Nice tip :)