Prevent a scroll from appearing in horizontal html

Asked

Viewed 158 times

0

Guys I’m configuring my css but it appears a scroll horizontally already tried in various ways and nothing! Follow the code:

@charset "UTF-8";

body{
  width: 100%;
  height: 100%;
  background-color: white;
}
li{
  color: white;
}
header#fundo-cima{
  width: 100%;
  position: absolute;   
}
header#fundo-cima img{
  width: 100%;
  height: 100px;
  position: absolute;
  top: 0px;
}
nav#Rodape-cima li{
  display: inline-block;
  position: relative;
  top: -100px;
  margin: 19px;
}
  • 1

    Place margin: 0; in the body.

  • Vlww bro! Help me+

2 answers

0

The body has a standard margin. When defining your width in 100%, he will have the total screen width + the standard margin, causing the area it occupies to be larger than the visible width of the screen, causing the horizontal scroll.

To avoid this, remove this margin from the body with the property margin: 0;:

body{
  margin: 0;
  width: 100%;
  height: 100%;
  background-color: white;
}

-1

Try putting in css

body {
  width: 100%;
  height: 100%;
  background-color: white;
  overflow-x: hidden; 
}

Browser other questions tagged

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