-6

Well , I have a site with margins and a footer with different background color. The problem is that the footer margins do not get colored in the same color as the specified footer color.
The Html code -

Here I would like color the green space orange. I have tried replacing the margin with padding , but it does not work .

Now the problem has been resolved. Do not answer.

Shaurya
  • 121
  • 4
  • 6

3 Answers3

0

Usepadding css property on footer instead of margin.

Margin, as such, doesn't have background color. Margin is invisible border, a space between two objects.

Refer this Stack Overflow answer to understand more.

Community
  • 1
  • 1
vatz88
  • 2,132
  • 2
  • 13
  • 21
0

Hard to tell without seeing the code but I'm assuming that if changing the margin to padding for your footer div didn't work then that element might be nested inside of the element with the margin that you're saying you're applying for the site. Move the footer DIV outside of that element and apply the padding to it, not sure though without seeing the code so I could be off on that

RogueRyan
  • 1
  • 1
0

You should use padding instead of margin in such case..

Hardi Shah
  • 349
  • 1
  • 15