create a <ul> with a triangle for the :active row - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL

Description

create a <ul> with a triangle for the :active row

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">
body {<!--   w w w.ja  va  2s  . co  m-->
   background:Chartreuse;
   font-family:sans-serif;
}

ul#objects {
   margin-left:-41px;
   list-style-type:none;
}

ul#objects li {
   cursor:pointer;
   text-align:center;
   margin-top:41px;
}

ul#objects li.active {
   cursor:pointer;
   text-align:center;
   margin-top:41px;
}

ul#objects li p {
   margin-top:0px;
   color:yellow;
   text-shadow:0px 2px blue;
}

.left-sidebar {
   height:610px;
   width:80px;
   position:fixed;
   left:0;
   top:0;
   background:pink;
   border-right:2px solid OrangeRed;
}

ul#objects li {
   overflow:hidden;
   position:relative;
}

ul#objects li.active:after, ul#objects li:hover:after {
   content:"";
   position:absolute;
   width:16px;
   height:16px;
   background:grey;
   box-shadow:0 0 4px BlueViolet;
   -webkit-transform:rotate(-46deg);
   top:6px;
   right:-9px;
}
</style> 
 </head> 
 <body> 
  <div class="left-sidebar"> 
   <ul id="objects"> 
    <li class="active"> <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> <p>Lorem ip</p> </li> 
    <li> <img src="https://www.java2s.com/style/demo/Safari.png" alt=""> <p>Lorem i</p> </li> 
    <li> <img src="https://www.java2s.com/style/demo/Firefox.png" alt=""> <p>Lorem </p> </li> 
    <li> <img src="https://www.java2s.com/style/demo/InternetExplorer.png" alt=""> <p>Lorem ips</p> </li> 
    <li> <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> <p>Lorem</p> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials