Create a diagonal content box - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Box

Description

Create a diagonal content box

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">
#parent {<!-- www.ja  v a2 s . c o m-->
   border:2px solid Chartreuse;
   height:100px;
}

#header {
   display:inline-block;
   border-bottom:2px solid yellow;
   padding:11px;
   position:relative;
}

#header:after {
   position:absolute;
   right:-18px;
   top:-8px;
   bottom:-9px;
   content:"";
   display:block;
   width:0px;
   border-left:2px solid blue;
   -webkit-transform:rotate(41deg);
   -moz-transform:rotate(41deg);
   transform:rotate(41deg);
}
</style> 
 </head> 
 <body> 
  <div id="parent"> 
   <span id="header">Lorem ip</span> 
  </div>  
 </body>
</html>

Related Tutorials