Ejercicio 226
Nota
Este ejercicio tiene una dificultad alta y necesita de algunas características de CSS que no se tratan en los contenidos:
- Atributo
fill
- Pseudo-elemento
::before
- Pseudo-clase
:first-child
Crea una página web que tenga el mismo aspecto que la siguiente imagen:
Probar en el navegador
Consideraciones:
- Utiliza etiquetas semánticas para estructurar el contenido.
- La web se divide en varias partes:
- Cabecera: incluye un logo.
- Migas de pan (breadcrumbs): sitúan al usuario o usuaria en qué parte de la web está. Las diferentes entradas son enlaces.
- Artículo principal: incluye el contenido del artículo principal.
- Tabla de contenidos (table of contents): situada en el lateral derecho. Las diferentes entradas son enlaces.
- El logo:
- Se proporciona en formato SVG y debe ser incluido directamente en el código HTML.
- La parte azul se debe colorear con CSS.
- El ancho es de 200 píxeles.
- En los breadcrumbs, se debe utilizar el caracter
>
como separador entre elementos, pero no se puede incluir en el HTML, sino que se debe realizar desde CSS. - Los enlaces deben enlazar a
#
. - El ancho del artículo es del 70% y el ancho de la tabla de contenidos es un 305.
- El ancho total (artículo y tabla de contenidos) es de 600 píxeles.
- La familia de fuentes utilizada es la cadena
"Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
. - Los colores utilizados son:
- Color predeterminado del texto:
#343a40
- Enlaces y logo:
#0068c2
- Fondo (migas de pan):
#e9ecef
- Borde (migas de pan):
#adb5bd
- Caracter
>
(migas de pan):#adb5bd
- Enlaces (migas de pan):
#495057
- Cursor encima del enlace (migas de pan):
#212529
- Título del artículo:
#212529
- Borde izquierdo (tabla de contenidos):
#dee2e6
- Enlace (tabla de contenidos):
#6c757d
- Cursos encima del enlace (tabla de contenidos):
#0068c2
- Color predeterminado del texto:
Cuando pasamos el cursor por encima de los enlaces, se muestran de la siguiente manera:
El logo es el siguiente:
<svg id="mdn-docs-logo" xmlns="http://www.w3.org/2000/svg" x="0" y="0" viewBox="0 0 694.9 104.4" xml:space="preserve" role="img"><title>MDN Web Docs</title><style>.logo-m{fill:var(--text-link)}</style><g class="logo-m"><path d="M40.3 0 11.7 92.1H0L28.5 0h11.8zM50.7 0v92.1H40.3V0h10.4zM91 0 62.5 92.1H50.8L79.3 0H91zM101.4 0v92.1H91V0h10.4z"></path></g><path class="logo-m" d="M627.9 95.6h67v8.8h-67v-8.8z"></path><g style="fill: var(--text-primary);"><path d="M367 42h-4l-10.7 30.8h-5.5l-10.8-26h-.4l-10.5 26h-5.2L308.7 42h-3.8v-5.6H323V42h-6.5l6.8 20.4h.4l10.3-26h4.7l11.2 26h.5l5.7-20.3h-6.2v-5.6H367V42zM401.9 62c-.4 3.2-2 5.9-4.7 8.2-2.8 2.3-6.5 3.4-11.3 3.4-5.4 0-9.7-1.6-13.1-4.7-3.3-3.2-5-7.7-5-13.7 0-5.7 1.6-10.3 4.7-14s7.4-5.5 12.9-5.5c5.1 0 9.1 1.6 11.9 4.7s4.3 6.9 4.3 11.3c0 1.5-.2 3-.5 4.7h-25.6c.3 7.7 4 11.6 10.9 11.6 2.9 0 5.1-.7 6.5-2 1.5-1.4 2.5-3 3-4.9l6 .9zM394 51.3c.2-2.4-.4-4.7-1.8-6.9s-3.8-3.3-7-3.3c-3.1 0-5.3 1-6.9 3-1.5 2-2.5 4.4-2.8 7.2H394zM445 53.7c0 5-1.3 9.5-4 13.7s-6.9 6.2-12.7 6.2c-6 0-10.3-2.2-12.7-6.7-.1.4-.2 1.4-.4 2.9s-.3 2.5-.4 2.9h-7.3c.3-1.7.6-3.5.8-5.3.3-1.8.4-3.7.4-5.5V22.3h-6v-5.6H416v27c1.1-2.2 2.7-4.1 4.7-5.7 2-1.6 4.8-2.4 8.4-2.4 4.6 0 8.4 1.6 11.4 4.7 3 3.2 4.5 7.6 4.5 13.4zm-7.7.6c0-4.2-1-7.4-3-9.5-2-2.2-4.4-3.3-7.4-3.3-3.4 0-6 1.2-8 3.7-1.9 2.4-2.9 5-3 7.7V57c0 3 1 5.6 3 7.7s4.5 3.1 7.6 3.1c3.6 0 6.3-1.3 8.1-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3.7 5.6 3.7 10.2v18.2h6.1v5.5zm42.5 0h-13.2V66c-1.2 2.2-2.8 4.1-4.9 5.6-2.1 1.6-4.8 2.4-8.3 2.4-4.8 0-8.7-1.6-11.6-4.9-2.9-3.2-4.3-7.7-4.3-13.3 0-5 1.3-9.6 4-13.7 2.6-4.1 6.9-6.2 12.8-6.2s9.8 2.2 12.3 6.5V22.7h-8.6v-5.6h15.8v50.6h6v5.5zm-13.3-16.8V52c-.1-3-1.2-5.5-3.2-7.3s-4.4-2.8-7.2-2.8c-3.6 0-6.3 1.3-8.2 3.9-1.9 2.6-2.8 5.8-2.8 9.6 0 4.1 1 7.3 3 9.5s4.5 3.3 7.4 3.3c3.2 0 5.8-1.3 7.8-3.8 2.1-2.6 3.1-5.3 3.2-8zm61.5 16.8H269v-5.5h6V51.9c0-3.7-.7-6.3-2.2-7.9-1.4-1.6-3.4-2.3-5.7-2.3-3.1 0-5.6 1-7.4 3s-2.8 4.4-2.9 7v15.9h6v5.5h-19.3v-5.5h6V42.4h-6.2v-5.6h13.6V43c2.6-4.6 6.8-6.9 12.7-6.9 3.6 0 6.7 1.1 9.2 3.3s3.7 5.6 3.7 10.2v18.2h6v5.4h-.2z"></path></g></svg>
Al incluirlo en el HTML, se mostrará así:
El contenido para el documento HTML es el siguiente:
References
HTML
HTML: HyperText Markup Language
HTML (HyperText Markup Language) is the most basic building block of the Web. It defines the meaning and structure of web content. Other technologies besides HTML are generally used to describe a web page's appearance/presentation (CSS) or functionality/behavior (JavaScript).
"Hypertext" refers to links that connect web pages to one another, either within a single website or between websites. Links are a fundamental aspect of the Web. By uploading content to the Internet and linking it to pages created by other people, you become an active participant in the World Wide Web.
In this article
Key resources
Beginner's tutorials
Advanced topics
Solución
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Maquetación estática</title>
<link rel="stylesheet" href="estilos.css" />
</head>
<body>
<header>
<svg id="mdn-docs-logo" xmlns="http://www.w3.org/2000/svg" x="0" y="0" viewBox="0 0 694.9 104.4" xml:space="preserve" role="img"><title>MDN Web Docs</title><style>.logo-m{fill:var(--text-link)}</style><g class="logo-m"><path d="M40.3 0 11.7 92.1H0L28.5 0h11.8zM50.7 0v92.1H40.3V0h10.4zM91 0 62.5 92.1H50.8L79.3 0H91zM101.4 0v92.1H91V0h10.4z"></path></g><path class="logo-m" d="M627.9 95.6h67v8.8h-67v-8.8z"></path><g style="fill: var(--text-primary);"><path d="M367 42h-4l-10.7 30.8h-5.5l-10.8-26h-.4l-10.5 26h-5.2L308.7 42h-3.8v-5.6H323V42h-6.5l6.8 20.4h.4l10.3-26h4.7l11.2 26h.5l5.7-20.3h-6.2v-5.6H367V42zM401.9 62c-.4 3.2-2 5.9-4.7 8.2-2.8 2.3-6.5 3.4-11.3 3.4-5.4 0-9.7-1.6-13.1-4.7-3.3-3.2-5-7.7-5-13.7 0-5.7 1.6-10.3 4.7-14s7.4-5.5 12.9-5.5c5.1 0 9.1 1.6 11.9 4.7s4.3 6.9 4.3 11.3c0 1.5-.2 3-.5 4.7h-25.6c.3 7.7 4 11.6 10.9 11.6 2.9 0 5.1-.7 6.5-2 1.5-1.4 2.5-3 3-4.9l6 .9zM394 51.3c.2-2.4-.4-4.7-1.8-6.9s-3.8-3.3-7-3.3c-3.1 0-5.3 1-6.9 3-1.5 2-2.5 4.4-2.8 7.2H394zM445 53.7c0 5-1.3 9.5-4 13.7s-6.9 6.2-12.7 6.2c-6 0-10.3-2.2-12.7-6.7-.1.4-.2 1.4-.4 2.9s-.3 2.5-.4 2.9h-7.3c.3-1.7.6-3.5.8-5.3.3-1.8.4-3.7.4-5.5V22.3h-6v-5.6H416v27c1.1-2.2 2.7-4.1 4.7-5.7 2-1.6 4.8-2.4 8.4-2.4 4.6 0 8.4 1.6 11.4 4.7 3 3.2 4.5 7.6 4.5 13.4zm-7.7.6c0-4.2-1-7.4-3-9.5-2-2.2-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7.3-2s5.3.7 7.5 2.1c2.2 1.4 3.7 3.5 4.5 6.4 1.1-2.5 2.7-4.5 4.9-6.1s4.8-2.4 7.9-2.4c3.5 0 6.5 1.1 8.9 3.3s3.7 5.6 3.7 10.2v18.2h6.1v5.5zm42.5 0h-13.2V66c-1.2 2.2-2.8 4.1-4.9 5.6-2.1 1.6-4.8 2.4-8.3 2.4-4.8 0-8.7-1.6-11.6-4.9-2.9-3.2-4.3-7.7-4.3-13.3 0-5 1.3-9.6 4-13.7 2.6-4.1 6.9-6.2 12.8-6.2s9.8 2.2 12.3 6.5V22.7h-8.6v-5.6h15.8v50.6h6v5.5zm-13.3-16.8V52c-.1-3-1.2-5.5-3.2-7.3s-4.4-2.8-7.2-2.8c-3.6 0-6.3 1.3-8.2 3.9-1.9 2.6-2.8 5.8-2.8 9.6 0 4.1 1 7.3 3 9.5s4.5 3.3 7.4 3.3c3.2 0 5.8-1.3 7.8-3.8 2.1-2.6 3.1-5.3 3.2-8zm61.5 16.8H269v-5.5h6V51.9c0-3.7-.7-6.3-2.2-7.9-1.4-1.6-3.4-2.3-5.7-2.3-3.1 0-5.6 1-7.4 3s-2.8 4.4-2.9 7v15.9h6v5.5h-19.3v-5.5h6V42.4h-6.2v-5.6h13.6V43c2.6-4.6 6.8-6.9 12.7-6.9 3.6 0 6.7 1.1 9.2 3.3s3.7 5.6 3.7 10.2v18.2h6v5.4h-.2z"></path></g></svg>
</header>
<nav class="breadcrumbs">
<div class="container">
<ol>
<li><a href="#">References</a></li>
<li><a href="#">HTML</a></li>
</ol>
</div>
</nav>
<main class="container">
<article class="w70">
<h1>HTML: HyperText Markup Language</h1>
<p>
<strong>HTML</strong> (HyperText Markup Language) is the most basic
building block of the Web. It defines the meaning and structure of
web content. Other technologies besides HTML are generally used to
describe a web page's appearance/presentation (<a href="#">CSS</a>)
or functionality/behavior (<a href="#">JavaScript</a>).
</p>
<p>
"Hypertext" refers to links that connect web pages to one another,
either within a single website or between websites. Links are a
fundamental aspect of the Web. By uploading content to the Internet
and linking it to pages created by other people, you become an
active participant in the World Wide Web.
</p>
</article>
<aside class="w30 toc">
<h2>In this article</h2>
<ul>
<li><a href="#">Key resources</a></li>
<li><a href="#">Beginner's tutorials</a></li>
<li><a href="#">Advanced topics</a></li>
</ul>
</aside>
</main>
</div>
</body>
</html>
estilos.css
* {
box-sizing: border-box;
}
body {
color: #343a40;
margin: 0;
padding: 0;
font-family: "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell",
"Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
}
header {
padding: 16px 0;
text-align: center;
}
header svg {
width: 200px;
}
header svg .logo-m {
fill: #0068c2;
}
.container {
width: 600px;
margin: 0 auto;
display: flex;
}
.breadcrumbs {
padding: 4px 0;
background-color: #e9ecef;
border-top: 1px solid #adb5bd;
border-bottom: 1px solid #adb5bd;
}
.breadcrumbs ol {
margin: 0;
padding: 0;
list-style: none;
display: flex;
}
.breadcrumbs li::before {
content: ">";
padding-right: 10px;
color: #adb5bd;
}
.breadcrumbs li:first-child::before {
content: "";
padding: 0;
}
.breadcrumbs li:first-child {
margin: 0 12px 0 0;
}
.breadcrumbs a {
color: #495057;
text-decoration: none;
}
.breadcrumbs a:hover {
color: #212529;
text-decoration: underline;
}
h1 {
font-weight: bold;
font-size: 30px;
color: #212529;
}
h2 {
font-weight: 200;
}
.toc ul {
border-left: 3px solid #dee2e6;
list-style: none;
padding: 0;
margin: 0;
}
.toc li {
padding: 6px 12px;
}
.toc a {
color: #6c757d;
text-decoration: none;
}
.toc a:hover {
color: #0068c2;
}
article a {
color: #0068c2;
}
.w70 {
width: 70%;
}
.w30 {
width: 30%;
}
Probar en el navegador