Div occupies the entire width of the screen

Asked

Viewed 265 times

0

I am building a layout where there is a bar at the top of the screen that plays from side to side. I used the property witdh:100%;, but I did not get a satisfactory result. The body of the page is covering the entire screen, but both this top bar and the one at the bottom of the page are not really 100%, both leave a blank, as I can solve?

como nesta foto

  • 1

    Ask the question what CSS you’re using. If you’re 100% meant to play from side to side.

  • probably just missing a clearfix on in your element.

1 answer

1


use a css reset for example:

* {
    border: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

Or Voce can just set the bar margin to 0 and the body padding to 0.

  • Vlw friend, solved my problem

  • I’m glad you liked the answers! But the best way to thank those who helped you is to mark "accept" the best answer and vote for all who helped you. This way you make sure that whoever wrote the answer gets something in return, as well as making the site cleaner and more useful for everyone. Adding a new answer like this (which is not an answer to the question and should be removed) makes the site more confusing and can get in the way.

  • @Renatojunior What is this * does precisely?

    • selects all page elements

Browser other questions tagged

You are not signed in. Login or sign up in order to post.