The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Newbie CSS question
I am new to css and trying to work on something. I need to make something like this: the first element of a list should have red colour and the last element sould have green colour. Since i am a begginer i have no ideea what code to put. Any help ?
I am sorry if i posted in the wrong section.
You could use first-child and last-child :
first-child
last-child
codepen.io/anon/pen/BKaqPg
Tyvm , exactly what i was looking for!
Life savior!!