css - how to select last element in the page? -
is there way select last appear of specific element css?
this example: demo
i tried last-child
not want. used class:
html:
<ul> <li><span>test</span></li> <li> <span>test</span> <span>test</span> </li> </ul> <div> <span>test</span> <span>test</span> </div> <p> <span>test</span> <span>red</span> </p>
css:
span:last-child{ color:red; font-weight:bold; }
i want last span
"red" content red. how can css ?
update: there solution last-of-type
elements same parents. different parents ?
try this: (you should aware of parent wrapper element)
body > *:last-child > span:last-child{ color: red; }
Comments
Post a Comment