Create a cross shape in CSS - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Shape

Description

Create a cross shape in CSS

Demo Code

ResultView the demo in separate window


<html>
 <head> 
  <style>
#cross {<!--from   w w w.j  a va2  s  . c  om-->
   width:100px;
   height:100px;
   position:relative;
}

#cross:before, #cross:after {
   content:"";
   position:absolute;
   z-index:-2;
   background:Chartreuse;
}

#cross:before {
   left:51%;
   width:31%;
   margin-left:-16%;
   height:100%;
}

#cross:after {
   top:51%;
   height:31%;
   margin-top:-16%;
   width:100%;
}
</style> 
 </head> 
 <body> 
  <div id="cross"></div>  
 </body>
</html>

Related Tutorials