logo

Miami SEO Service from $199

Be found when people search online with Miami SEO. Get your business on Google today.

GET SEO SERVICE ➔

CSS: How to make margins or padding work on a DIV with width 100%

In responsive design, often times you’ll want to change the width of elements from static to 100% wide with some margins or padding.

If you set a DIV width to 100%, margins and padding will be ignored. The solution is to reset the DIV to it’s default which is “auto” which will stretch as wide as it possible and include margins and/or padding

width: auto;