Daniel Siebert Daniel Siebert - 4 months ago 30
CSS Question

Bootstrap changing margins

Is there a way to change the contents margin on the left and right of the screen when the content is displayed on a mobile device?
So that the content has a margin on a desktop and no margin on a phone.
Any Ideas?


Yeah, use media queries. With media queries you can say that at a certain width of the screen there should be a certain css activated. For example, when your screen is not more than 400px wide, it should bring the font size back to 10px. Try it with the following code as an example:

@media screen and (max-width: 400px){
        font-size: 10px;

Good luck!