Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get a div to go across the whole page

Whenever i try to make a div with width 100%, it does not go across the whole page, it leaves small margins on either side(top bottom left and right), i would like the div to go across the whole page, such as the header bar on the top of this page.

like image 316
foshoeiyyy Avatar asked Dec 22 '22 04:12

foshoeiyyy


1 Answers

You have to set margin and padding of body element to 0. Like this (in CSS):

body
{
  margin: 0;
  padding: 0;
}

And also remember about setting margin of div element to 0.

like image 120
psur Avatar answered Jan 03 '23 15:01

psur