6
I’m trying to centralize my research form in the center of my div but I’m not getting any property in css that does this without needing ganbiarra? here is the development page
index.html
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="#" >
</script>
</head>
<body>
<div>
<form action="search.php" method="GET" class="fc">
<input type="text" autocomplete="on" name="q" placeholder="Digite a sua pesquisa" />
<input type="submit" value="Tecle Enter" />
</form>
</div>
</body>
</html>
css style.
* {
margin: 0;
padding: 0;
vertical-align: baseline;
}
html body {
background-color: ghostwhite;
}
body div {
display: block;
width: 90%;
height: 123px;
margin: 0 auto;
border: 2px dashed black;
}
div .fc {
margin: 0 auto;
}
see I’ve set margin: 0 auto;
in my div
and in my class .fc
but it’s not working
result n naavegador
Horizontally and vertically?
– David
To the
margin: 0 auto;
work yourform
has to have a fixed width as well!– Igor Mello
in the two, now when I set the width it became trunk hanging to the right
– user45474