I have td tags and a several div inside td:
-
Well actually you can do this with css using the nth-last-child selector
FIDDLE
So if your markup was like this:
test
test
test
CSS
div:nth-last-child(n+2) ~ div:last-child{
margin-bottom: 40px;
}
... the above css will style the last div element only if there exists a container that has at least 2 child divs
Just to see how this works better - here's another example fiddle
- 热议问题