I was reading and watching a lot of video about Floats.. but I don't get it yet... I have nav with floats after it I have a normal div, I put "clear:both", but I can't put it "margin" to my div, but I can put it "padding", that's works more or less like I want.. but I'd like to learn why it is happening... THANKS YOU GUYS!
*{margin:0;padding:0;box-sizing:border-box;}
body {
background-image: url(../fondo.jpg);
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
nav {
background-color: rgba(0,0,0,.5);
color: #fff;
width: 1000px;
margin: 0 auto;
}
ul {
display: block;
list-style-type: none;
text-align: center;
}
.ul-main > li {
width: 33.3%;
float: left;
}
.ul-main li a {
background-color: #000;
display: block;
color: #fff;
text-decoration: none;
padding: 10px 0;
transition: background-color .5s;
}
.ul-main li a:hover {
background-color: #FBC02D;
}
.ul-main li ul {
display: none;
position: absolute;
width: 20%;
}
.ul-main li:hover > ul {
display: block;
}
.ul-main li ul li {
position: relative;
}
.ul-main li ul li a {
background-color: #FBC02D;
}
.ul-main li ul li a:hover {
background-color: #FFEB3B;
}
.ul-main li ul li ul{
right: -70%;
top:0;
width: 70%;
}
.clear {
clear: both;
}
.wrapper {
width: 500px;
margin-top: 1000px;
}
<!DOCTYPE>
<html>
<head>
<meta charset="utf-8"/>
<title>Ejercicio de Maquetación</title>
<meta http-equiv="refresh" content="60"/>
<link rel="stylesheet" href="css/contacto.css"/>
<link rel="stylesheet" href="css/header.css"/>
</head>
<body>
<header>
<nav>
<ul class="ul-main">
<li><a href="index.html" >Inicio</a></li>
<li class="somos"><a href="#" >Quienes somos</a>
<ul>
<li><a href="#" >Historia</a></li>
<li id="azul"><a href="#" >Proyectos</a>
<ul>
<li><a href="#" >Huerta para estudiantes</a></li>
<li><a href="#" >Comedor</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="contacto.html" >Contacto</a></li>
</ul>
</nav>
</header>
<section class="wrapper clear">
<h2>Infórmate!</h2>
</section>
</body>
</html>