Image with declared width and height renders square before load

后端 未结 6 2356
不思量自难忘°
不思量自难忘° 2021-02-13 11:15

I have images with declared widths and heights, e.g.:

\"bar\"

They are within

6条回答
  •  盖世英雄少女心
    2021-02-13 11:40

    Right off the bat I notice that you are using px instead of % for width and height. Responsive HTML 5 DOCType. you should use percentage. There to many phones and tablets out there visiting your website.

    Use meta tag viewport in your headers. Try something like this

     
    

    For further information on how to correctly re-size your web page for any device go here https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag

    I recon-mind that you use CSS to control the height and width of the image try to stay away from attributes if possible. Use min and max along with your width and height sectors for width and height in you CSS code. You don't need JavaScript to solve your issues

提交回复
热议问题