Answers for "how to give width so it works on all screen sizes css"

2

how to change style based on screen size

.adjust-me-based-on-size{
  margin-left: 15%;
  margin-right: 15%;
}
@media only screen and (min-width: 800) and (max-width: 1200) {
  .adjust-me-based-on-size {

    margin-left: 10%;
    margin-right: 10%;
  }
}
@media only screen and (max-width: 800px) {
  .adjust-me-based-on-size {
    margin-left: 5%;
    margin-right: 0%;
  }
}
 Run code snippet
Posted by: Guest on November-13-2021
0

if the screen size is then link a css file html

<link rel="stylesheet" media="screen and (min-device-width: 800px)" href="800.css" />
Posted by: Guest on August-03-2021

Browse Popular Code Answers by Language