html - How do I position a div below an image with changing height? -


in new site have image set width 100% , text underneath that. how change position of text based on height of image?

html:

<div class = "pic">     <img src="#"/> </div> <div class ="text">     <h3>some important message</h3> </div> 

css:

.pic{     position:absolute;     left:0;     width:100%; } .pic img{     position:absolute;     width:100%; }  .text{     position:relative;     margin-top:10px; } 

as requested, here fiddle https://jsfiddle.net/slx3n2vz/

please try this:

remove css , add only

.pic{     width:100%; } .pic img{     width:100%; } .text{     margin-top:10px; } 

demo

the way positioning html element wrong. please correct it.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -