CSS Styling lists that contain links - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

CSS Styling lists that contain links

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
ul {<!--from   w  w w  .  j  a v  a  2s .c om-->
   margin:0;
   padding:0;
   list-style:none;
}

li {
   background:url('https://www.java2s.com/style/demo/Google-Chrome.png') no-repeat left 51%;
   padding-left:41px;
}

li a {
   background:url('https://www.java2s.com/style/demo/Google-Chrome.png') no-repeat left 51%;
   display:block;
   margin-left:-41px;
   padding-left:41px;
}

li a:hover {
   background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png');
}
</style> 
 </head> 
 <body> 
  <ul> 
   <li>Lorem</li> 
   <li>Lorem </li> 
   <li> <a href="#">Lorem</a> </li> 
  </ul>  
 </body>
</html>

Related Tutorials