Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to change values of padding for mobile only in bulma css framework?

Tags:

html

css

bulma

So I built a website using Bulma css framework. I set the padding-left and padding-right for every element to 10%. On a mobile device the padding needs to be smaller. Maybe a 5% or less it doesn't matter. But I don't know how to change that padding for mobile devices only. I didn't find help in their documentation. Can someone help? For example:

nav{    
    padding-left: 10%;
    padding-right: 10%;
}

That I want to be:(but only for mobile devices)

nav{    
    padding-left: 5%;
    padding-right: 5%;
}
like image 272
J. Drag Avatar asked Sep 07 '25 21:09

J. Drag


1 Answers

You can use media queries in css for assigning classes to specific devices. Please refer this

Example for mobile device:

@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
    .mobile-device {
        //styles for mobile
    }
}
like image 159
Shruti Bhagwate Avatar answered Sep 09 '25 20:09

Shruti Bhagwate