Samar Yadav Samar Yadav - 8 months ago 41
CSS Question

Add margin on both sides of free space(background) in Html - css page

I am trying to add margin on both sides of free space in Html. and fill background in the middle remaining part only.

But this id doesn't work when i put it in body tag.

display: block;
margin-left: 100px;
margin-right: 100px;
background-color: #E3EAEA;

above given colors are random. Result should be like this.

capture[![this should be the result]1

Thanks for helping.


Just make body white and add a container div. Like here: