Make triangle border width responsive - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Make triangle border width responsive

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">
.hp-product-item {<!-- w  w  w .  j  av a 2s  .com-->
   position:relative;
   display:inline-block;
}

.hp-product-item img {
   max-width:501px;
   width:100%;
}

.hero-overlay {
   position:absolute;
   bottom:0;
   width:100%;
   height:100%;
   background:linear-gradient(20deg, yellow 26%, Chartreuse 26%);
}

.hero-text {
   position:absolute;
   bottom:11px;
   left:11px;
}
</style> 
 </head> 
 <body> 
  <div class="hp-product-item"> 
   <img src="https://www.java2s.com/style/demo/Safari.png"> 
   <div class="hero-overlay"></div> 
   <div class="hp-product-text"> 
    <div class="hero-text"> 
     <h2>Lore</h2> 
     <p>Lorem ipsum </p> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials