Removing the margin that the browser automatically receives

when we create a web page using bootstrap, we can set the margin. but the web browser makes some profit. although the code is as a div (class = "container-liquid") or the code as a field: 0; and indentation: 0; Based on the container in the CSS file, I could not solve the problem. help me

+4
source share
5 answers

Some browsers have a difference in body tag. Set this to 0 somewhere in your css.

body {
    margin: 0;
}
+1
source

This is the default field for the browser for the body:

To fix this.

body {
   margin:0;
}
+1
source

, -

body{
margin:0
}

, h-, , ( )

h4{
margin: 0 !important
}
+1

, .

reset margin body :

body {
    margin: 0;
}

reset ( ) css normalize.css.

Normalize.css . , .

GitHub, Twitter, Soundcloud, Guardian, Medium .

+1

Despite the fact that you put container liquid, sometimes it does not make the width 100% suitable for the screen, because the browser does the default margin and filling. To make it fit on the screen, you need to do like this:

body {

padding: 0;
margin: 0;

}

If this does not work, make them important, as shown below.

body {

padding: 0 !important;
margin: 0 !important;

}

+1
source

Source: https://habr.com/ru/post/1680051/


All Articles