Font family in pseudo element - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Font

Description

Font family in pseudo element

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">
@font-face {
   font-family:'Icons';
   src:url('https://www.java2s.com/style/demo/Google-Chrome.png') format('woff3'), url('https://www.java2s.com/style/demo/Google-Chrome.png') format('woff');
   font-weight:normal;
   font-style:normal;
}

body>div {
   display:table;
}

body>div>.a:before,
body>div>.d:before,
body>div>.e:before {
   font-family:Icons;
   display:table-cell;
   content:'H';<!--  w  w w  . j ava2 s  . co m-->
}

.e {
   font-family:Icons;
}

body>div>.b:before {
   font-family:Icons;
   display:inline-block;
   content:'H';
}

body>div>.c:before {
   display:table-cell;
   content:'H';
}
</style> 
 </head> 
 <body> 
  <div> 
   <div class="a"> 
   </div> 
   <div class="b"> 
   </div> 
   <div class="c"> 
   </div> 
   <div class="d"> 
   </div> 
   <div class="e"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials