So, I have this css code to format a html page. The problem is that, when I view the page in the browser, I get it as not formated at all. Div’s titulo and titulo2 are simples text lines and the formulario’s div is a form. I want the form to be centered to the page, with a margin-left and right auto.
Thanks
@charset "utf-8";
/* CSS Document */
#titulo{
background:white;
text-align:center;
};
#titulo2{
background:white;
text-align:center;
};
#formulario{
margin-left: auto ;
margin-right: auto ;
width: 400px;
display: inline-block;
};
Ok, so here is my html:
<body>
<p>
<div id="titulo">Área Pessoal</div>
</p>
<p>
<div id="titulo2">Registo de Saídas</div>
</p>
<div id="formulario"><form>
<p>
<label>Data e hora : <input /></label>
</p>
<p>
<label>Morada : <input /></label>
</p>
<p>
<label>Localização Geográfica : <input /></label>
</p>
<p>
<label>Tipo de saída : <input type="radio" name="tipo" value="Sozinho" />Sozinho</label><input type="radio" name="tipo" value="Acompanhado" />Acompanhado</label>
</p>
<p>
<label>Condições Atmosféricas : <input /></label>
</p>
<p>
<label>Altura da maré : <input type="radio" name="mare" value="Alta" />Alta</label><input type="radio" name="mare" value="Baixa" />Baixa</label>
</p>
<p>
<label>Temperatura da Água : <input /></label>
</p>
<p>
<label>Visibilidade Dentro de Água : <input type="radio" name="visibilidade" value="Boa" />Boa</label><input type="radio" name="visibilidade" value="Má" />Má</label>
</p>
<p>
<label>Peixes Capturados : </label>
</p>
<p>
<label>espécies <input type="text" /></label>
</p>
<p>
<label>compimento <input type="text" /></label>
</p>
<p>
<label>peso <input type="text" /></label>
</p>
<p>
<label>Upload Ficheiros Multimédia :<br />
<input type="file" name="ficheiro" multiple>
</label>
<p><input type="submit" value="Enviar"><input type="reset"></p>
</form></div>
<p>
<label><a href="historico_saidas.html">Histórico de Saídas</a></label>
</p>
<p>
<label><a href="estatisticas.html">Estatisticas</a></label>
</p>
</body>
</html>
This might be obvious, but are your divs labelled correctly?
Example
<div id="titulo"></div>You’ve got closing tags after the style, but after that the easist way is probably to wrap everything with a div
HTML:
etc..