html - How to set background image using picture tag and src set -


how set image background div.so div should take height of image.this functionality need implemented using picture tag , srcset attribute in html.and if text overlays on image image should remain in same height div height should grow text. below code tried div height not increasing

<style> .image {     position: relative;     width: 100%; /* ie 6 */ }  .info{     position: absolute;     top: 200px;     left: 0;     width: 100%;     color: yellow; }    </style> <script src="picturefill.min.js"></script>   <div class="image">     <picture>         <source srcset="new-york-city-wallpapers-desk.jpeg" media="(min-width: 1240px)">         <source srcset="new-york-city-wallpapers-tab.jpeg" media="(min-width: 940px)">         <source srcset="new-york-city-wallpapers-mob.jpeg" media="(min-width: 724px)">          <img srcset="" src="new-york-city-wallpapers-mob.jpeg" alt="" />     </picture>       <div class="info">       <h1>the new galaxy s7 edge | galaxy s7</h1></br>       <h2>go dipper samgung's brightest new stars-available now-and</h2></br>       <h2>learn our limited-time special offers.</h2>        </div>`enter code here`  </div> 


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -