override "display:inline-block" with "display: block" - HTML CSS CSS Property

HTML CSS examples for CSS Property:display

Description

override "display:inline-block" with "display: block"

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">
body {<!-- w  ww.  j av a 2s. com-->
   background-color:Chartreuse;
}

div {
   float:left;
   margin:6px;
}

a {
   background-color:yellow;
   color:blue;
}

div.ib a {
   font-size:17px;
   display:inline-block;
   *display:inline;
   height:31px;
   border:2px solid pink;
}

div.normal>a {
   display:block;
}

div.blockbyclass>a {
   display:block;
   *height:auto;
   *padding-bottom:15px;
}
</style> 
 </head> 
 <body> 
  <div class="normal"> 
   <a href="#">Lore</a> 
   <a href="#">Lorem ipsum</a> 
  </div> 
  <div class="ib blockbyclass"> 
   <a href="#">Lore</a> 
   <a href="#">Lorem ipsum</a> 
  </div> 
  <div class="ib"> 
   <a href="#" style="display: block;*height:auto;*padding-bottom:14px;">Lore</a> 
   <a href="#" style="display: block;*height:auto;*padding-bottom:14px;">Lorem ipsum</a> 
  </div>  
 </body>
</html>

Related Tutorials