Ejercicio 3

đź’» CĂłdigo HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="css/fragmentos.css">
    <title>Document</title>
</head>
<body>
    <H1>Fragmentos</H1>
    <h2>A</h2>
    <div class="menu">
    <div class="titulo">LMSGI</div>
    <ul>
   <li><a href="#">â–¶ DAM</a></li>
   <li><a href="#">â–¶ ASIR</a></li>
   <li><a href="#">â–¶ IES Valle del Jerte</a></li>
    </ul>
   </div>
    <hr>

    <h2>B</h2>
    <div class="banner">
    <img src="img/banner_skills_2016.jpg" alt="banner">
    <a href="http://iesvjp.es" target="_blank">Más información</a>
   </div>
    <hr>

    <h2>C</h2>
    <div class="runner">
    <p class="modo">MODO RUNNER</p>
    <h2>¿Qué es mejor: correr cinco minutos o caminar 15?</h2>
   </div>
    <hr>

    <h2>D</h2>
    <div class="bloque-justicia">
    <hr>
    <a href="#" class="justicia">Justicia</a>
   </div>
    <hr>

    <h2>E</h2>
    <div class="videos">
  <h2>VÍDEOS <a href="#" class="ver-mas">Ver más vídeos</a></h2>
   </div>
    <hr>

    <h2>F</h2>
    <div class="bloques">
    <div class="bloque premios">PREMIOS</div>
    <div class="bloque desayunos">DESAYUNOS</div>
    <div class="bloque foros">FOROS</div>
   </div>
    <hr>

    <h2>G</h2>
    <div class="menu-estudios">
    <ul class="menu-principal">
        <li class="item">
        Qué, cómo y dónde estudiar
            <ul class="submenu">
                <li>Qué estudiar <span class="flecha">▶</span></li>
                <li>CĂłmo estudiar <span class="flecha">â–¶</span></li>
                <li>DĂłnde estudiar <span class="flecha">â–¶</span></li>
                <li>Cuándo inscribirse <span class="flecha">▶</span></li>
            </ul>
        </li>
    </ul>
  </div>
    <hr>

    <h2>H</h2>
    <ul id="h">
    <li>
        <div>IES Valle del Jerte <span>&#8744;</span></div>
        <ul>
            <li><a href="#">Cliclos Formativos</a></li>
            <li><a href="#">ESO</a></li>
            <li><a href="#">Bachillerato</a></li>
            <li><a href="#">Consejo Escolar</a></li>
        </ul>
    </li>
</body>
</html>
        

🎨 Código CSS

body {
    font-family: Arial, sans-serif;
}

.menu {
    width: 200px;
    background-color: #1e4f8a;
    color: white;
    padding: 10px;
}

.titulo {
    font-weight: bold;
    cursor: pointer;
}

.menu ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    display: none;
}

.menu ul {
    display: block;
}

.menu li {
    margin: 5px 0;
}

.menu a {
    color: white;
    text-decoration: none;
    display: block;
}
.lista {
    display: flex;
    align-items: flex-start;
    margin-top: 10px;
}

.menu {
    width: 220px;
    background-color: #1e4f8a;
    color: white;
    padding: 10px;
    font-family: Arial, sans-serif;
}

.banner {
    width: 250px;
    margin: 20px;
    position: relative; 
}

.banner img {
    width: 100%;
    display: block;
}

.banner a {
    position: absolute;     
    bottom: 10px;
    left: 10px;
    background-color: white;
    color: green;
    padding: 14px 22px;
    font-size: 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: bold;
}

.runner {
    width: 100%;
    max-width: 900px;; 
    height: 180px;
    background-image: url("../img/corre.jpg");
    background-size: cover;
    background-position: right center;
    background-repeat: no-repeat;
    padding: 30px;
    margin: 20px 0;
    box-sizing: border-box;
}
.runner .modo {
    color: #7ac943;
    font-weight: bold;
    margin: 0;
}

.runner h2 {
    margin-top: 10px;
    font-size: 26px;
    color: #615151;
    font-weight: normal;
}

.bloque-justicia {
    position: relative;
    margin: 30px 0;
}

.bloque-justicia hr {
    border: none;
    border-top: 2px solid #2f6fa3;
    margin: 0;
}

.justicia {
    position: absolute;
    top: 1px;   
    left: 0;
    background: #5b8db8;
    color: white;
    padding: 6px 12px;
    font-weight: bold;
    text-decoration: none;
}

.videos {
    margin-top: 40px;
}

.videos h2 {
    font-size: 28px;        
    font-weight: bold;
    color: #0b3c5d;
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    gap: 10px;
}

.videos .ver-mas {
    font-size: 16px;        
    font-weight: normal;
    color: #2f6fa3;
    text-decoration: none;
    margin-left: 10px;

}

.videos .ver-mas::before {
    content: "|";
    margin: 0 10px;
    color: #2f6fa3;
}

.videos .ver-mas:hover {
    text-decoration: underline;
}

.videos hr {
    border: none;
    border-top: 3px solid #2f6fa3; 
    margin-top: 2px;              
    width: 100%;
}

.bloques {
    margin-top: 30px;
}

.bloque {
    display: inline-block;        
    width: 220px;
    height: 90px;
    line-height: 90px;          
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    color: white;
    margin-right: 15px;
    cursor: pointer;
    transition: all 0.3s ease;   
}

.premios {
    background-color: #928b7f;
}

.desayunos {
    background-color: #7b878d;
}

.foros {
    background-color: #886d6d;
}

.bloque:hover {
    opacity: 0.6;                 
    color: #ffffff;
}

.menu-g {
    list-style: none;
    padding: 0;
    margin-top: 30px;
    width: 260px;
    font-family: Arial, sans-serif;
}

.menu {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 260px;
    font-family: Arial, sans-serif;
}

.menu > li {
    background-color: #0e6a7a;
    color: white;
    padding: 10px;
    cursor: pointer;
    position: relative;
}

.menu {
    margin-top: 20px;
}

.menu-estudios {
    margin-top: 20px;
    width: 420px;
    font-family: Arial, sans-serif;
}

.menu-estudios {
    margin-top: 20px;
    font-family: Arial, sans-serif;
}

.menu-principal {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    width: 420px;
}

.menu-principal > li {
    padding: 10px;
    color: white;
    cursor: pointer;
    box-sizing: border-box;
}

.menu-principal > li:first-child {
    background: #0e4953;
    width: 260px;
    position: relative;
    border-right: 1px solid rgba(255,255,255,0.4);
}

.menu-principal > li.pruebas {
    background: #0e4953;
    width: 160px;
    text-align: center;
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    position: absolute;
    top: 100%;
    left: -1px;
    width: calc(100% + 1px);
    background: #1b6f7a;
    border: 1px solid #1b6f7a;
    border-top: none;
}

.submenu li {
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,0.3);
}

.menu-principal > li:first-child:hover .submenu {
    display: block;
}

.flecha {
    float: right;
}

.menu-h {
    width: 220px;
    font-family: Arial, sans-serif;
}

.menu-h {
    width: 220px;
    font-family: Arial, sans-serif;
}

.menu-h ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-h {
    width: 230px;
    font-family: Arial, sans-serif;
}

.menu-h ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-h a {
    display: block;
    padding: 10px;
    text-decoration: none;
    border-bottom: 1px solid #ddd;
    color: #666;
}

.menu-h {
    width: 260px;
    font-family: Arial, sans-serif;
}

.menu-h ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-h a {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: #666;
    background: white;
}

.menu-h {
    width: 260px;
    font-family: Arial, sans-serif;
}

.menu-h ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-h a {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: #a59f9f;
    background: white;
}

.menu-h .titulo-menu {
    border-bottom: 2px solid #ccc;
}

.menu-h .titulo-menu:hover,
.menu-h .titulo-menu:focus {
    color: #6bbf2d;
    border-bottom: 2px solid #6bbf2d;
    font-weight: bold;
}

.flecha {
    float: right;
    color: #8f8888;
}

.menu-h .titulo-menu:hover .flecha {
    color: #6bbf2d;
}

.submenu-h {
    display: none;
}

.menu-h li:hover .submenu-h {
    display: block;
}

.submenu-h a {
    background: white;
    color: #998a8a;
}

.submenu-h a:hover {
    background: #444141;
}

ul#h
ul#h ul {
    padding-left: 0px;
    list-style-type: none;
}
ul#h > li > div {
    font-weight: bold;
    color: grey;
    font-size: larger;
    border-radius: 4px solid lightgrey;
    padding: 10px;
}
ul#h  {
    width: max-content;
}
ul#h ul li {
    padding: 10px;
    border-bottom: 1px outset white;
}
ul#h ul li a {
    color: grey;
    background-color: #eee;
    text-decoration: none;
}
ul#h ul {
    border-bottom: 2px solid grey;
}
ul#h ul li:hover {
    background-color: grey;
    color: white;
    cursor: pointer;
}
ul#h ul li:hover a {
    color: white;
}
ul#h ul {
    display: none;
}
ul#h > li:hover ul {
    display: block;
}
ul#h > li:hover > div {
    color: green;
    border-bottom-color: green;
}
ul#h > li > div span {
    font-size: small;
}



        

📸 Resultado del ejercicio

Resultado
⬅ Volver