HTML image height (in %) does not change? -


example: http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_img_height can change width in terms of % or px but, can change height in terms of px , not % (you can experiment changing height % , seeing not change). example wondering how change height in terms of %? thank you.

if want use percentage height in div, parent objects of have have explicit height property. unlike width, website fixed heights bring problems.

my advice: don't use percentage height in html. instead, try padding

#mydiv{    padding-bottom: 20%; } 

see here more info.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -