Home > front end >  Removing margin from body
Removing margin from body

Time:02-10

Trying to fix some styling for some old bootcamp projects I've done.

What I'm trying to currently change here is removing the margin from the body element of the page. Essentially, I want the "Search for a City" sidebar to be positioned on the far left of the screen rather than where it is now and for the other content to move over along with it.

I've explicitly set body margin and padding to 0 and even tried some justify-contents here and there in the css but nothing is changing. The solution is probably super simple but does anybody have an idea of what I need to change to get this simple change done? Thanks so much in advance.

The app can be found here:

https://giovannimalcolm.github.io/weather-dashboard/

incorrect positioning

correct positioning

CodePudding user response:

The body element doesn't have any margin. The reason the "Search for City" is not all the way to the left is because the <div > has margin-left: auto; pushing it right. Remove that and it goes all the way to the left.

  •  Tags:  
  • Related