Currently working on developing a responsive webpage. An interesting challenge is presenting two distinct images for the desktop and mobile views. Attempted to switch between images by utilizing the @media feature within CSS, as shown below.
#login-top-shadow{
max-width: 100%;
@media only all and (max-width: 700px) {
content:url("img/login_top_shadow_mobile.png");
}
}
The image designated for display in the desktop view has been set as the src attribute of my image tag.
Despite my efforts, when resizing the page, the image fails to reflect the change. It seems that modifications are successful in the CSS styles in the console, but they do not translate to the html document.
Is this method considered appropriate for handling images in the context of responsive web design? Attached is a screenshot of my console for reference.https://i.stack.imgur.com/QmoSW.png