Answers for "css command to change div with screen size"

CSS
1

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
7

how to set a div size to full screen

height: 100vh
Posted by: Guest on July-27-2020

Code answers related to "css command to change div with screen size"

Browse Popular Code Answers by Language