1
so guys, I’m starting to study html and css, I’m trying to make a page with a side menu with the homescreen next to it, but the homescreen box doesn’t go up to the side of the menu bar, I don’t know if the code is wrong, if anyone can help... thank you, follow the html and css below:
* {
margin: 0;
padding: ;
font-family: roboto;
}
.menu {
background-color: #052e40;
width: 200px;
height: 100vh;
text-align: right;
vertical-align: middle;
display: table-cell;
line-height: 50px;
padding-right: 50px;
}
a {
text-decoration: none;
color: #15b6ff;
}
li {
list-style-type: none;
}
@font-face {
font-family: 'roboto';
src: url('roboto.ttf');
font-weight: normal;
font-style: normal;
}
.menu nav ul li a:hover {
color: white;
}
hr {
color: #15b6ff;
}
.home {
background-color: red;
width: 300px;
height: 100vh;
float: left;
}
<!DOCTYPE HTML>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<meta name="author" content="Nil">
<meta name="description" content="Site Simples">
<link rel="stylesheet" href="este.css">
</head>
<body id="corpo">
<!--Barra lateral/Menu-->
<section id="Barralat">
<div class="menu">
<nav>
<ul>
<li><a href="#">Pagina Inicial</a></li>
<hr>
<li><a href="#">Quem Somos Nós</a></li>
<hr>
<li><a href="#">Cursos</a></li>
<hr>
<li><a href="#">Pré-Matricula</a></li>
<hr>
<li><a href="#">Fale Conosco</a></li>
<hr>
</ul>
</nav>
</div>
</section>
</section>
<!--Final da barra lateral/menu-->
<!--pagina inicial-->
<section class="home">
Pagina Inicial
</section>
</body>
</html>
Speak brother, your tip worked, the layout was, in appearance, the way I want, but then when I went to format a text in "home", I noticed that the home was actually occupying 100% of the screen behind the menu, I wanted it to be on the right side of the menu, because the menu will be fixed and the scrolling of the sessoes will be done occupying only the rest of the screen next to the menu. tried to put the width of the menu in percentage but defaults all.
– Elenilton Silva
if you know a way to solve I will be grateful...
– Elenilton Silva
@Eleniltonsilva Read the EDIT which I did in the reply and execute the code on full page. I think now it became clearer what you wanted, I left the details of how to fix the menu and how to take off the menu at the bottom of the EDIT response.
– hugocsl
helped a lot, solved, thank you.
– Elenilton Silva
@Eleniltonsilva if you solve the problem and you think the question has been answered consider mark it as OK! So it is not open on the site as Unresolved Question. Good luck ai tmj
– hugocsl