Cascading Style Sheets
Reglas de Estilo
Propiedades o Estilos
Estructura
Selector ejemplo: body {
Bloque de Declaraciones entre llaves { }
Propiedad y Valor ejemplo: backgroud-color: blue;
Separador de Declaraciones ;
Sintaxis
Regla:
selector {
propiedad: valor; (declaración)
}
Etiqueta
Class
Id
<head>
<style>
header {
background-color: #333;
}
</style>
</head>
<body>
<header><h1>Título de Contenido</h1></header>
</body>
<head>
<style>
.box {
background-color: #333;
}
</style>
</head>
<body>
<div class="box">
</div>
</body>
<head>
<style>
#content {
text-align: justify;
}
</style>
</head>
<body>
<div Id="content">
</div>
</body>
<p style="font-family: verdana;">Texto de Contenido</p>
<p>Texto de <span style="color: red;">Contenido</span> en un párrafo.</p>
<head>
<link rel="stylesheet" href="estilos.css">
</head>
En el archivo estilos.css
p {
text-align: center;
}