css - how to define padding of a container in responsive design -


i have styles like:

.main-title {     background: #000;     color: #fff;     font: normal 1.5em "league gothic", "arial narrow", arial, sans-serif;*/     text-transform: uppercase; } 

now don't know exact height of main-title container multi-line title.

how may declare consistent padding irrespective of it's height?

just normal padding rule add consistent padding irrespective elements height.

.main-title {     padding: 10px; } 

you can use percents, torr3nt mentioned, , make padding respective width of element's parent. have created this fiddle show mean this. if element positioned absolute percent based of closest relatively positioned ancestor.


Comments

Popular posts from this blog

javascript - JS causing window size to be bigger than necessary - Dropdown bug -

php - Calling a template part from a post -

How to mention the localhost in android -