HTML CSS examples for CSS Widget:UL Element
Change specific list item properties
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #header ul {<!-- ww w . ja v a2 s . co m--> padding-top:2em; } #header ul li a.currentpage { color:Chartreuse; background-color:yellow; } #header ul li a { text-decoration:none; color:blue; font-family:'Oswald', sans-serif; font-size:2em; float:right; line-height:4em; padding-right:2em; padding-left:2em; } #header ul li a.one:hover { background-color:pink; color:OrangeRed; } #header ul li a.two:hover { background-color:grey; color:BlueViolet; } #header ul li a.three:hover { background-color:Chartreuse; color:yellow; } #header ul li a.four:hover { background-color:blue; color:pink; } </style> </head> <body> <div id="header"> <img id="logo" src="https://www.java2s.com/style/demo/InternetExplorer.png"> <ul> <li> <a class="one" href="#">Lorem i</a> </li> <li> <a class="two" href="#">Lorem i</a> </li> <li> <a class="three" href="#">Lorem </a> </li> <li> <a class="four" href="#">Lorem</a> </li> </ul> </div> </body> </html>