Is there a way to use media max width to load a page

Viewed 28

Hope your doing well, I was doing a project a I got into this problem is there anyway to use <link media="(max-width: 800px)" href="example.html"> to load a html project?

1 Answers

Well, If you mean responsive design, you can use media queries as follows in your style.css file:

/* Start of your default CSS editing for desktop layouts */
.class-name {
        /* Styling of class for desktop (large) screens */
}
/* End of your default CSS editing for desktop layouts */

/* Here goes media queries for different layouts */

@media screen and (max-width: 768px) {
   .class-name {
        /* Styling of class for mobiles and tablets */
   }
}

@media screen and (max-width: 1024px) {
   .class-name {
        /* Styling of class for medium-sized screens */
   }
}

Find more at MDN documentation for media-queries

Related