Menu with upper margin

Asked

Viewed 33 times

-2

So I’m creating a page and I want to put a menu, but before it is creating a top margin. How do I take it?

<div class="barra">
    <p>asdaosdhs</p>
</div>
.barra{
background-color: aqua;
margin-top: 0px;
top: auto;
left: 0;
right: 0;
height: 100px;
}

1 answer

0

The CSS comes with some preset things, this upper margin comes because of these settings.

Use this from here to reset your CSS

/* Reset */

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

.barra {
  background-color: aqua;
  margin-top: 0px;
  top: auto;
  left: 0;
  right: 0;
  height: 100px;
}
<div class="barra">
  <p>Hello, world!</p>
</div>

Browser other questions tagged

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