Sou iniciante em HTML/CSS, estou estudando e quebrando a cabeça aqui para fazer uma sidebar/sidemenu.
O texto que eu coloco nos botões nunca ficam alinhados com o ícone que eu coloco.
<!DOCTYPE html-5>
<head>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
<div id="mySidebar" class="sidebar">
<a href="#">
<span class="sidebar_item">
<img src="iconsgrey/HomeIcon.png" alt="">
<span>Início</span>
</span>
</a>
<a href="#">
<span class="sidebar_item">
<img src="iconsgrey/PersonIcon.png" alt="">
<span>Opção 2</span>
</span>
</a>
</div>
</body>
body {
background-color: orange;
}
.sidebar {
position: fixed;
height: 100%;
width: 250px;
background-color: black;
padding: 0;
margin: 0;
top: 0;
left: 0;
}
.sidebar_item {
background-color: white;
/*top right bottom left*/
padding: 20px 30px 20px 20px;
font-size: 30px;
font-family: Helvetica, monospace;
color: #ababab;
display: block;
vertical-align: middle;
}
.sidebar_item span {
background-color: green;
margin-top: 0px;}
.sidebar img {
max-width: 40px;
max-height: 40px;
width: auto;
height: auto;
padding-right: 20px;
background-color: blue;
margin: 0;
}
.sidebar a {
text-decoration: none;
color: black;
display: block;
}