Este ejercicio consiste en aplicar diferentes propiedades de texto y fuente en CSS para practicar estilos avanzados como tipografías, tamaños, alineaciones, transformaciones y estilos decorativos. A partir del HTML base proporcionado, se deben cumplir las reglas indicadas en el enunciado.
Enunciado
- Definir estilos base para el
body. - Aplicar propiedades de fuente y texto al título principal.
- Estilizar el párrafo introductorio en cursiva.
- Dar formato a los subtítulos del contenido.
- Mejorar el primer párrafo del
sectioncon line-height y justificado. - Estilizar el blockquote con borde, fondo y color personalizado.
- Aplicar negrita, separación de letras y color al segundo párrafo.
- Diseñar correctamente el pie de página.
Código HTML
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Combinando Propiedades de Texto y Fuente</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>Guía Completa de CSS</h1>
<p class="intro">Bienvenido a la guía completa...</p>
</header>
<section>
<h2>Introducción a las Propiedades de Fuente</h2>
<p class="text1">CSS permite modificar las fuentes...</p>
<blockquote class="highlight">"Las propiedades de fuente..."</blockquote>
<h2>Propiedades de Texto</h2>
<p class="text2">Además de la fuente, CSS...</p>
</section>
<footer>
<p>© 2024 Guía CSS</p>
</footer>
</body>
</html>
Código CSS
body {
font-family: Arial, sans-serif;
font-size: 16px;
line-height: 1.6;
}
header h1 {
font-family: Georgia, serif;
font-size: 36px;
color: #333;
text-align: center;
text-transform: uppercase;
}
header .intro {
font-style: italic;
font-size: 14px;
color: #666;
}
section h2 {
font-family: Verdana, sans-serif;
font-size: 24px;
color: #007acc;
text-decoration: underline;
}
.text1 {
font-family: sans-serif;
font-size: 16px;
line-height: 1.5;
text-align: justify;
}
blockquote.highlight {
font-family: 'Times New Roman', serif;
color: #2a7a1f;
background-color: #f0f8f8;
margin-left: 10px;
border-left: 3px solid #2a7a1f;
padding: 8px;
}
.text2 {
font-weight: bold;
font-size: 16px;
letter-spacing: 1px;
color: #444;
}
footer p {
font-size: 12px;
text-align: center;
color: #888;
}