Soldato
- Joined
- 12 Feb 2006
- Posts
- 17,669
- Location
- Surrey
i've got list of links which could be any length. i've styled them to have border-bottom but i want the first one to have border-top. how do i do this?
UL.myClass LI:first-child { border-top: 1px solid #CCC; }
not as keen on psuedi selectors for the reason you suggested. [...]
Browser support for first-child:
I hate to say it, but that's like saying, "maybe I shouldn't style links in general in case I forget I'm using it". You simply just don't forget what CSS you've used.first-child seems like the best option then but my concern is that what happens when i add something before the list of links in the future and forget i'm using it? say an image which now becomes the first child.?
yeah, ... li:first-childis there a way to say first-child:li ?
Then yeah, the image will have the top border [well, technically, the <li> or <a> containing the image will].[...] what happens when i add something before the list of links in the future and forget i'm using it? say an image which now becomes the first child. [...]