Css:-. Before selector

    The ::before selector inserts something before the content of each selected elements.
    Use the content property to specify the content to insert.

Code:-


<!DOCTYPE html> 
<html> 
 
<head> 
 <meta name="viewport" content="width=device-width, initial-scale=1"> 
 
 <style> 
  div::before { 
   border-left: 5px solid red; 
   content: ""; 
  } 
 </style> 
 
</head> 
 
<body> 
 <div> 
  before is used to add some styles to front of the HTML elements. 
 </div> 
 
</body> 
 
</html>


Output:-



before is used to add some styles to front of the HTML elements.

Css:-. Before selector Css:-. Before selector Reviewed by Network security on May 12, 2019 Rating: 5

No comments:

Useful Information

Powered by Blogger.