Forums
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hello. How i can choose only three number with (nth-last-of-type). me need choose only 1,2,3. not 3,2,1. how i can do this?
Your question isn’t quite clear enough.
Could you try and explain further, perhaps with a Codepen.io or JSfiddle.net example?
For the example it doesn’t matter how you use CSS to get the result looking the way you want…we can always adapt it from what you show us.
i tried to use -n+3 but this mean 3,2,1 not exactly what me need.
Your question still isn’t quite clear enough.
Could you try and explain further, perhaps with a Codepen.io or JSfiddle.net example?
You mean like this?
http://codepen.io/Paulie-D/pen/cFbyu
li:nth-last-of-type(-n+3) {
margin-bottom: 0;
}
watch please my example it’s not solution for last 2,3 blocks. but for one blocks it is working.
Paulie_D, hm your example works but why my not working(
Because you are re-using ID’s which is not allowed AND your green block has a different ID.
You can’t use pseudo-classes like nth-last-of-type
on classes or IDs…only elements.
Green block must be new contain a another width and another content.
I don’t no why but i used id with:nth and it working for me.
but how i can solve this problem?.
How i can delete this (margin) in last three red blocks?
don’t using id.
write for each rule?
Please help :)
anybody?(
write for each rule?
Probably, yes.
I would advise not trying to use these pseudo-classes and just use proper unique IDs and classes.
It’s still not clear to me what you are trying to do.
hm its must be without (margin-bottom).like this one Photobucket.
Actually in the photo i delete (margin-bottom) directly for each in css. But i think it’s not solution true? I don’t know)
Nope:
#wrap div:nth-last-of-type(-n+6).block {
margin-bottom:0;
}
This did the trick.