position <a> tag to the right inside <li> tag - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

position <a> tag to the right inside <li> tag

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">
#cssmenu li {<!--from   w  w  w  .j av a 2 s  . c  o m-->
   margin:0;
   padding:0;
   background:Chartreuse;
   border-bottom:2px solid yellow;
   color:blue;
   display:block;
   margin:0;
   padding:9px 13px;
   text-decoration:none;
   font-weight:bold;
   border-radius:5px 5px 5px 5px;
   -moz-border-radius:5px 5px 5px 5px;
   -webkit-border-radius:5px 5px 5px 5px;
}

#cssmenu li:hover {
   background:pink url('https://www.java2s.com/style/demo/Google-Chrome.png') left center no-repeat;
   color:OrangeRed;
   cursor:pointer;
   padding-bottom:9px;
}

#cssmenu li.project_on {
   background:grey url('https://www.java2s.com/style/demo/Google-Chrome.png') left center no-repeat;
   color:BlueViolet;
   cursor:pointer;
   padding-bottom:9px;
}

#cssmenu li a {
   margin-right:3px;
   padding-left:6px;
   float:right;
}
</style> 
 </head> 
 <body> 
  <ul id="cssmenu"> 
   <li>Lorem<a>Lorem ipsu</a> </li> 
   <li>Lorem<a>Lorem ipsu</a> </li> 
   <li>Lorem<a>Lorem ipsu</a> </li> 
  </ul>  
 </body>
</html>

Related Tutorials