Jump to content

Tirar a margem de cima


Go to solution Solved by TheDark,

Recommended Posts

Posted

Oi pessoal.

Na minha luta para aprender HTML e CSS, tenho-me deparado com alguns obstáculos que felizmente tenho conseguido ultrapassar sozinho. No entanto, não sei porque motivo é que aparece uma margem no topo da página. Segue um exemplo da página e o código..

http://img105.imageshack.us/my.php?image=screenshotep8.png

<html>
<head>
	<title>Foto 1</title>
	<link rel="stylesheet" type="text/css" href="style.css"/>
</head>	
<body>
	<div id="center">
		<h1 class="center">This text is just to see how it looks!</h1>
	</div>
</body>
</html>
 
body{
margin:0;
background-color:gray;
}

#center{
padding:0;
margin-left:auto;	
margin-right:auto;
background-color:white;
width:800px;
height:100%;
}
h1.center{
text-align:center;
color:gray;
}
p.s. Tenham em mente que ainda sou muito novato nestas andanças, portanto nada de gozar com a monha página super evoluída.. 😛😛 lol
  • Solution
Posted

O único problema que o Firefox tem é que respeita as regras, e torna-se fácil cometer erros. Agora se isso é um problema já é outra questão... :👍

Acrescrenta ali o margin-top ao h1.center:

h1.center{
text-align:center;
color:gray;
margin-top:0px;
}

e problema resolvido!

Desaparecido.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.