Jump to content

Recommended Posts

Posted

Boas estou a fazer uma pagina simplesmente dom DIV's (estou a aprender a fazer) e tenho uma duvida que é a seguinte, eu no CSS (style.css) tenho isto:

body {
font:Verdana;
font-size:10px;
color:#CCCCCC;
background-color:#333333;
margin:0px;
}

#header {
background-color: #CCCCCC;
background-image:url(images/header.gif);
background-repeat:repeat-x;
height: 25px;
}

div.header-text {
color:#333333;
text-align:center;
}

e no HTML tenho isto:

<div id="header" class="header-text">Login - Registar-se</div>

Ok ta tudo a funcionar como deve de ser o unico problema é que o texto nao aparece com fonte Verdana nem com o tamanho 10px ! acho muito estranho, alguem sabe porque?

Posted

Uma coisa que se ouve muito lá fora: KISS (Keep It Simple Stupid) 😛

Estas a usar uma class e um id sem necessidade 😁

Podes por tudo num só e poupar muitas linhas para chegares ao mesmo efeito 👍

body {
font:10px Verdana;
color:#CCCCCC;
background-color:#333333;
margin:0px;
}

div#header {
color:#333333;
text-align:center;
background-color: #CCCCCC;
background-image:url(images/header.gif);
background-repeat:repeat-x;
height: 25px;

}

<div id="header">Login - Registar-se</div>
Posted

eu tinha assim com explicas-te e n deu dps separei pa ver se tinha alguma coisa a ver e nao funcionou na mesma, continua a font sem ser verdana e sem ser tamanho 10px! esse e q é o meu problema!

Posted

Aqui funciona perfeitamente tanto em IE como em Firefox.

Usei este código para testar:

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
	"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
	<title>CSS Test</title>
	<meta http-equiv="Content-Type" content="application/xhtml+xml" />
	<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
</head>
<body>
	<div id="header">Login - Registar-se</div>
</body>
</html>

<3 life

Posted

tks ja consegui por a  bombar 🙂

EDIT: o header é uma div de 25 px, e o texto aparece no top da div eu  gostava que aparecesse no meio, ha maneira de colocá-lo no meio ou tenho de utilizar o margin / padding ?

Posted

tipo das-lhe a instrução position=middle que ele deve ficar no meio. Não testei.

Our lives begin to end the day we become silent about things that matter - Martin Luther King

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.