Display legend tag in the middle of the border - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Border Style

Description

Display legend tag in the middle of the border

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 {<!--from w ww.ja va2 s. co m-->
   background-color:#000000;
   padding:30px;
}
.title {
   background-color:#000000;
   padding:0 15px;
   font-size: 20px;
   color:#ffffff;
}
.top_box {
   text-align:center;
   display:block;
   line-height:0;
   border-bottom:2px solid #b7b7b7;
   height:0;
}
.box {
   padding: 20px;
   border: 2px solid #b7b7b7;
   border-top: none;
   text-align: justify;
   color: white;
}


      </style> 
 </head> 
 <body> 
  <div class="top_box"> 
   <span class="title">TITLE</span> 
  </div> 
  <div class="box">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 
  </div>  
 </body>
</html>

Related Tutorials