Avoid shifting a small box that ends a paragraph - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Box

Description

Avoid shifting a small box that ends a paragraph

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">
.black-square {<!--from  w w w.j a v  a2s  .  co  m-->
   position:relative;
}

.black-square:after {
   content:"";
   width:11px;
   height:11px;
   background:Chartreuse;
   display:inline-block;
   position:relative;
   left:11px;
}
</style> 
 </head> 
 <body> 
  <p class="black-square">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper molestie lacus sed fermentum. Aliqua</p>  
 </body>
</html>

Related Tutorials