Add content to before and after <p> - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:after

Description

Add content to before and after <p>

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <style>
.day:before {<!--from w  w w. java 2 s  .  c  o m-->
   content:"\a2 ";
   display:block;
   float:left;
   margin-right:3%;
}

.day:after {
   content:"!";
   padding-left:3%;
}
</style> 
 </head> 
 <body> 
  <p class="day">test</p>  
 </body>
</html>

Related Tutorials