Practical Exercise 16: Divisions and Spans
Learn how to use tags<div> and <span>Use HTML to structure and style your web content. This practical exercise teaches you how to effectively apply block and inline headings to your pages.
Activity
Use the tags<div> and <span>to organize and style your content.
Interactive Solution
Solution with complete HTML code
HTML
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8" />
<title>Div y Span</title>
<style>
.contenedor {
background-color: #f0f0f0;
padding: 20px;
}
.texto-destacado {
color: red;
font-weight: bold;
}
</style>
</head>
<body>
<div class="contenedor">
<p>
Este es un párrafo dentro de un
<span class="texto-destacado">div</span> contenedor.
</p>
</div>
</body>
</html>