If the body has padding: 0px 10px; , how can you remove this style from one of the internal elements, and then the indents remain, but they should not be - in the footer, at least?

As an example:

styles:

 body {padding: 0px 10px;} 

code:

 <body> <div id="header"></div> <div id="content"></div> <div id="footer"></div> </body> 

In the footer there should be no padding in this case.

  • Please give a code sample ... - C.Raf.T
  • #content {padding: 0} - C.Raf.T

1 answer 1

In your case, the box-sizing property will help.

 #footer{ box-sizing: border-box; } 

Or just remove padding

 #footer{ padding: 0; } 

Although I could not understand you correctly. You set the padding for the parent. In order that the footer would roughly ignore this indent from the outside, you can give the footer a negative margin which will be equal to the indent * -1

 #footer{ margin: 0 -10px; } 
  • Only the last option worked, but it worked. - Timur Musharapov