Escolar Documentos
Profissional Documentos
Cultura Documentos
Usando HTML
<body bgcolor="#FF0000">
Usando CSS
body { background-color: #FF0000; }
Como usar
Aqui identificamos
Aqui identificamos Aqui identificamos
o elemento que qual o valor
qual propriedade
queremos formatar
Como usar
<html>
<head>
<title>Exemplo</title>
</head>
<body style="background-color: #FF0000;">
<p>Esta é uma página com fundo vermelho</p>
</body>
</html>
Tag Style
Podemos aplicar CSS, usando a tag STYLE do HTML:
<html>
<head>
<title>Exemplo</title>
<style type="text/css">
body { background-color: #FF0000; }
</style>
</head>
<body>
<p>Esta é uma página com fundo vermelho</p>
</body>
</html>
Arquivo externo
<html>
<head>
<title>Exemplo</title>
<link rel="stylesheet" type="text/css" href="estilos.css" />
</head>
<body>
<p>Esta é uma página com fundo vermelho</p>
</body>
</html>
Arquivo externo
Teste no navegador.
Altura e largura
Podemos definir as dimensões de nossos
elementos, respectivamente, altura e largura.
width: 100px;
height: 80px;
p{
font-family: Tahoma, Arial, Verdana;
font-size: 11px;
color: #CCCCCC;
}
Fontes
Superior
Inferior
Direita
Esquerda
Superior
Direita
Inferior
Esquerda
margin-top
margin-right
margin-bottom
margin-left
margin
Margens
Exemplo:
margin-top: 30px;
margin-right: 10px;
margin-bottom: 30px;
margin-left: 10px;
Ou:
Exemplo:
padding-top: 30px;
padding-right: 10px;
padding-bottom: 30px;
padding-left: 10px;
Ou:
cor da borda
border-right-width: 1px;
border-right-style: solid;
border-right-color: red;
border-width: 1px;
border-style: solid;
border-color: red;
border-right-style: none;
border-style: none;
Exercício
Crie uma lista não ordenada (ul), contendo os
membros da sua família.
Coloque os seguinte estilos nesta lista:
Cor de fundo: amarelo;
Texto: escolha uma fonte, e coloque tamanho 14;
Altere o caracter usado na tag li;
.introducao {
text-family: Tahoma, Arial, Verdana;
font-size: 11px;
color: #CCCCCC;
}
fonte de texto;
cor do texto;
bordas;
margens.
Floating
Por exemplo:
<div class="picture">
<img src="foto.jpg">
</div>
<div class="picture">
<img src="foto.jpg">
</div>
.picture {
position: absolute;
top: 100px;
left: 200px;
}
Posicionando elementos
Podemos também, além de top e right, definir
as posições em função de bottom e left.
http://wwwmaujorcom/tutorial/fonttutphp
Dave Raggett's Introduction to CSS
http://wwww3org/MarkUp/Guide/Style
HTMLnet – CSS Tutorial
http://pt-brhtmlnet/tutorials/css/
UFSCAR – Desenvolvimento para Web
http://www.dc.ufscar.br:8080/latosensu/index.j
sp?site=calendario/index.html