Same padding at start and end of each line - HTML CSS CSS Property

HTML CSS examples for CSS Property:padding

Description

Same padding at start and end of each line

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 {<!--from   w  w  w  .  j ava2 s  .  c o  m-->
   width:481px;
   margin:0 auto;
   background:Chartreuse;
   padding:0 11px;
}

.marker {
   background:yellow;
   padding:4px 0;
   position:relative;
   left:-11px;
   line-height:31px;
}

.marker .marker {
   left:21px;
}

.marker .marker .marker {
   left:-11px;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <span class="marker"> <span class="marker"> <span class="marker">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliquam erat volutpat. Vestibulum tortor neque, ornare vitae tempor hendrerit, luctus at neque. Phasellus sed quam pharetra, tincidunt tortor in, pharetra nisl. Maecenas aliquam luctus mauris, vitae venenatis diam imperdiet vel. Donec tortor diam, pretium vitae nibh vitae, consectetur lacinia sem. Proin luctus facilisis volutpat. Ut semper sit amet purus quis ornare. Quisque lobortis neque vitae tempor iaculis. Aliquam erat volutpat. Mauris tincidunt eget lacus eget pulvinar. Suspendisse potenti. Maecenas blandit tempus metus, eu ornare eros egestas sit amet. Cras et ar</span> </span> </span> 
  </div>  
 </body>
</html>

Related Tutorials