Anchor <a> with inline-block spans inside - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:a

Description

Anchor <a> with inline-block spans inside

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">
a.button {
   text-decoration:none;<!--from w ww . j  a va2  s .c o m-->
   display:inline-block;
}

a.button span {
   text-decoration:none;
   display:inline-block;
   font-family:Arial,Helvetica,sans-serif;
   font-size:12px;
   font-weight:bold;
   height:31px;
}

a.button .left, a.button .right {
   background-color:Chartreuse;
   width:11px;
}

a.button .text {
   background-color:yellow;
   color:blue;
}

.button2 {
   background-color:pink;
   border:11px solid WhiteSmoke;
   border-top:0;
   border-bottom:0;
   display:inline-block;
   color:OrangeRed;
   font-family:Arial,Helvetica,sans-serif;
   font-size:12px;
   font-weight:bold;
   line-height:31px;
   text-decoration:none;
   padding:0 4px;
}
</style> 
 </head> 
 <body> 
  <a class="button" href="#"> <span class="left">&nbsp;</span> <span class="text">Text Text Text</span> <span class="right">&nbsp;</span> </a> 
  <br> 
  <br> 
  <a class="button2" href="#">Text Text Text</a>  
 </body>
</html>

Related Tutorials