CSS - Placing image next to centered text - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image Text

Description

CSS - Placing image next to centered text

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">
#nav li {<!--from   www .j a  va 2  s . c  o  m-->
   background:Chartreuse;
   padding:6px;
   float:left;
   width:171px;
   margin-right:6px;
   text-align:center;
}

#nav li a {
   position:relative;
   display:inline-block;
}

#nav li a span {
   position:absolute;
   right:-16px;
   top:6px;
   display:block;
   width:9px;
   height:9px;
   background:green;
}
</style> 
 </head> 
 <body> 
  <ul id="nav"> 
   <li> <a href="#">Lorem ipsu<span></span> </a> </li> 
   <li> <a href="#">Lorem ipsum dolor s<span></span> </a> </li> 
   <li> <a href="#">Lorem ipsum d<span></span> </a> </li> 
  </ul>  
 </body>
</html>

Related Tutorials