Menu
Coddy logo textTech

Sección "Acerca de"

Parte de la sección Styling with CSS del Journey de HTML de Coddy — lección 69 de 76.

challenge icon

Desafío

Fácil

A continuación, daremos estilo a la sección About utilizando diseños fluidos e imágenes flexibles para asegurar que se vea genial en todos los tamaños de pantalla.

Tu tarea es aplicar técnicas de diseño fluido e imágenes flexibles para la sección con la clase about para hacerla responsiva. Sigue los pasos a continuación:

1. Dar estilo al contenedor de la sección

  1. Escribe una regla CSS que apunte al elemento <section> con la clase about.
  2. Añade padding para crear espacio interior.
  3. Establece un max-width para evitar que la sección se estire demasiado.

2. Dar estilo al texto

  1. Escribe una regla CSS que apunte al elemento h2 y establece su color.
  2. Escribe una regla CSS que apunte al elemento p y aplica un color de texto legible.

3. Dar estilo a la imagen

  1. Escribe una regla CSS que apunte al elemento img.
  2. Establece su width a 40vw para hacerla responsiva.
  3. Usa float: right; para posicionarla al lado del texto.
  4. Añade un margen de 10px para crear espacio alrededor de la imagen.

Pruébalo tú mismo

<html>
    <head>
        <title>Swim with Whales in Tonga</title>
        <link rel="stylesheet" href="styles.css">  
    </head>
    <body>
        <nav class="menu">
            <a href="#">About</a>
            <a href="#">Experience</a>
            <a href="#">Contact</a>
        </nav>    
        <header class="welcome">
            <h1>Swim with Whales in Tonga</h1>
            <p>Experience the magic of swimming alongside majestic humpback whales.</p>
        </header>    
        <section class="about">
            <h2>About Tonga</h2>
            <img src="https://upload.wikimedia.org/wikipedia/commons/8/88/Hawaiian_Islands_Humpback_Whale_National_Marine_Sanctuary_breaching_2018.png">
            <p>Tonga is a stunning Polynesian archipelago in the South Pacific, famous for its crystal-clear waters and vibrant marine life. From July to October, humpback whales migrate here to breed, offering a rare chance to swim with these gentle giants. Beyond whale encounters, Tonga boasts pristine beaches, lush tropical landscapes, and a rich cultural heritage. Visitors can explore traditional villages, experience authentic Tongan hospitality, and enjoy activities like snorkeling, diving, and sailing. Whether you're seeking adventure or relaxation, Tonga provides an unforgettable escape into nature’s beauty.</p>
            </section>      
        <section class="contact">
            <h2>Plan Your Adventure</h2>
            <table>
                <tr>
                    <td>Phone Number</td>
                    <td>+676 123 4567</td>
                </tr>
                <tr>
                    <td>Email</td>
                    <td>info@tongawhales.com</td>
                </tr>
            </table>
    </section>
</body>
</html>

Todas las lecciones de Styling with CSS