TheWalkingPlay2500 TheWalkingPlay2500 - 13 days ago 6
CSS Question

Bootstrap responsive height

I'm making a website and I'm making a register form, but I need to adjust div height's according to wiewport, something like this:

xs devices: 12

sm devices: 9

md devices: 7

Note: I'm using bootstrap 4

Answer

Something like this :

@media only screen and (max-width: 500px) {
   div{
       height: 12px;
   }
}

You can use this website to find the viewport sizes for multiple devices and you replace the max-width by the size you want.

The media querry will check for your screen size and applies the directives inside the block if the condition is true.

More about media queries here and here

Comments