I'm trying to position a button type button in the center of the screen. For this, I put it in a div
, and applied to that div
a css that arrows its position in the window.
However, the button continues to appear in the left corner.
Here is my code:
<!DOCTYPE html>
<html>
<!--Tratar um click com html5: -->
<head>
<style type="text/css">
#centralizar{position:absolute top:50% left:50%}
</style>
</head>
<body>
<script>
function fuiClicado(){
document.write("Fui clicado");
}
</script>
<div id="centralizar">
<button name="cent" onClick="fuiClicado()"> Clique Aqui</button>
</div>
</body>
</html>