In my website, I’d like to design a header image in Photoshop. It will be responsive via max-width:100%
However, at mobile screen width it should change to a different image, something more suited for that size screen. How is that done in HTML or CSS?
4
Answers
Using
Media Query
you can do something like this or you can change the width to one that fit your needs:Check this Link it will help you
instead of
img
tag use background image for your header and change its src in media querylike
If you are using core CSS and HTML then use Background Image for your header and fix the background size.
This will adjust the background view according to display size.
Instead you can use bootstrap classes for best responsive look.
Using Bootstrap Classes:
For small screens:
For Large screens:
You can use images with different dimensions for different size of screens.
Refer bootstrap for better knowledge.
you can find your answer here http://anzblog.com/2017/05/15/change-htmlcss-header-image-depending-page-width/