How to increase or decrease the width of the nav bar by using the media in CSS
I am trying to decrease and increase the side bare width of the side bar by using media in CSS.
@media (min-width:289px)and (max-width:1100px){
.nav .lib{
width: 100px;
}
}
3
Answers
First, set a default width for your navbar that will apply when none of the media query conditions are met.
Then, use media queries to change the width based on the viewport’s width. You’ve already started this; you can continue by adding more conditions for different ranges.
first you have to set a default width for ex:
second you have to add the specific value you want for specific media dimensions ex:
You just need to add one value either min-width / max-width two values are not needed unless you targeting a specific device.
For mobiles, the min-width starts from 320px for your future reference.