html - Text over Image - Make is responsive for smaller screens -


i'm new programming , i'm trying modify retina template customize shopify store. it's been fun far , have had results!

however i'm stuck on question: how make code responsive?

i managed add html , css codes have text on image, can't figure out make responsive (text automatically adjust size) smaller screens (ex. mobile)

html code

<div class="textoverimage">     <img src="xxxxxx" alt="xxxx">      <h7> text </h7> </div> 

css code:

/* #custom styles ================================================== */  .textoverimage {     position: relative;     width: 100%;  }  h7 {     position: absolute;     top: 75px;     left: 0;     width: 100%;    text-align: center; } 

i used h7 not interfere preexisting codes (shopify used h1-h6)

you can attain through media queries.

@media screen , (max-width:500px) {     h7 {         font-size:14px;     } } 

this make font size of h7 14px when screen width drop below 500px.


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -