0
I found here the solution, in case someone needs
position:absolute;
top: 500px;
left: 200px;
Hello guys I started a new test here for an application, and I’m having trouble putting the button in the center of HTML via css, follow the code:
<!DOCTYPE HTML>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<title>TESTE SCANIA</title>
<!-- Aqui chamamos o nosso arquivo css externo -->
<link rel="stylesheet" type="text/css" href="css\estilos.css" />
</head>
<body>
<div id="teste">
</div>
<form>
<div id="botao">
<input type="submit" name="INICIAR TESTE" value="INICIAR TESTE" class="botaoEnviar" />
</div>
</form>
</body>
</html>
and the css
body{
background-color: #373435;
}
#teste{
width: 1920px;
height: 1080px;
background-image: url(background.jpg);
background-repeat: no-repeat;
}
#botao{ text-align: absolute }
.botaoEnviar{
width: 350px;
text-align: absolute;
left: 100%;
top: 100%;
margin-left:-110px;
margin-top:-40px;
padding: 15px 20px;
border: 1px solid #eee;
border-radius: 6px;
background-color: #FCC302;
font-size: 18px;
}
What do you define by center? horizontal, vertical, or both?
– Guilherme Lautert
both, would be two buttons one aligned on the other side in the middle of the screen both horizontal and vertical
– Felipe Deolindo
could position:Absolute; top: 500px; left: 200px;
– Felipe Deolindo
Felipe, post your solution as answer in the field below. Ask the question can disrupt it.
– user28595
@Felipedeolindo It seems to me that your solution will only work in your window size.
– Leon Freire