Answers for "scale 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
3

include screen size

Min:
@media (min-width: @screen-sm-min) // >= 768px (small tablet)
@media (min-width: @screen-md-min) // >= 992px (medium laptop)
@media (min-width: @screen-lg-min) // >= 1200px (large desktop)
Max:
@media (max-width: @screen-xs-max) { // < 768px (xsmall phone)
@media (max-width: @screen-sm-max) { // < 992px (small tablet)
@media (max-width: @screen-md-max) { // < 1200px (medium laptop)
Posted by: Guest on January-05-2021

Browse Popular Code Answers by Language