-4
I want to know why my "button" with the class="botaoHpr"
is not aligned with the h3
and in the middle of the page. (NOTE: is a simple site and this HPR is a group of my and my friends)
button {
border-style: solid;
border-color: indigo;
padding: 10px;
width: 150px;
height: 50px;
display: inline-block;
margin: 10px;
cursor: pointer;
border-radius: 4px;
margin: 0 auto;
text-align: center;
}
h3 {
color: black;
font-size: 20px;
font-family: Arial;
text-align: center;
}
body {
background-color: lightblue;
}
<!DOCTYPE html>
<html lang="pt">
<meta name="viewport" content="width=device=width,initial-scale=1">
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
<style>
</style>
<head>
<title>
HPR
</title>
</head>
<body>
<div class="botão.h3">
<H3>Entre na HPR</H3>
<button href="https://www.youtube.com/watch?v=MrhDr-11rrw" class="botaoHpr">HPR</button>
</div>
</body>
</html>
Do not use
.
or#
to name classes, even if it is allowed in HTML in CSS it is not. Then in HTML change the class attributebotão.h3
forbotãoh3
and in CSS create rule.botãoh3 { display: grid; justify-content: center; }
remembering that this is an alternative of many possible and that if the question explained/detailed what and how it hoped to manipulate the rendering boxes could arise one or more surprising answers.– Augusto Vasques
Thank you very much! I was coding for Vscode
– Doodods