Set border based on padding from content - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Border Style

Description

Set border based on padding from content

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">

#container {<!-- ww w  . j a v a  2  s .  co  m-->
   margin: 0px 60px 0px;
}
#eachitem {
   padding: 5px 2px 5px 5px;
   border: 5px solid black;
   display: inline-block;
   word-wrap: break-word;
}


      </style> 
 </head> 
 <body> 
  <div id="container"> 
   <div id="eachitem">
     Lorem ipsum dolor sit amet. 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials