Css :- Target tab Tag

    The links contain target element can aligned horizontally as tabs. It hides all element except the corresponding link.
    The :target selector can be used to style the current active target element.


<!DOCTYPE html> 

<html> 

 

<head> 

 <meta name="viewport" content="width=device-width, initial-scale=1"> 

 

 <style> 

  span { 

   display: none; 

  } 

   

   :target { 

   display: block; 

  } 

 </style> 

 

</head> 

 

<body> 

 <a href="#tar1">Tab 1</a> 

 <a href="#tar2">Tab 2</a> 

 <a href="#tar3">Tab 3</a> 

 <br> 

 

 <br> 

 <span id="tar1">This is the target 1</span> 

 <span id="tar2">This is the target 2</span> 

 <span id="tar3">This is the target 3</span> 

 

</body> 

 

</html>

Css :- Target tab Tag Css :- Target tab Tag Reviewed by Network security on May 23, 2019 Rating: 5

No comments:

Useful Information

Powered by Blogger.