1
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
one css that arrow your position on the window.
However, the button still appears in the left corner.
Just follow 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>
Thank you. I don’t really know the html and css syntax yet. I haven’t forgotten, actually I didn’t even know the semicolon. haha.
– Lucas Pletsch