Menu
Coddy logo textTech

Seção Sobre

Parte da seção Styling with CSS do Journey de HTML da Coddy — lição 69 de 76.

challenge icon

Desafio

Fácil

Em seguida, estilizaremos a seção About usando layouts fluidos e imagens flexíveis para garantir que ela tenha uma ótima aparência em todos os tamanhos de tela.

Sua tarefa é aplicar técnicas de layout fluido e imagens flexíveis para a seção com a classe about para torná-la responsiva. Siga os passos abaixo:

1. Estilize o contêiner da seção

  1. Escreva uma regra CSS que tenha como alvo o elemento <section> com a classe about.
  2. Adicione preenchimento (padding) para criar espaço interno.
  3. Defina um max-width para evitar que a seção se estique demais.

2. Estilize o texto

  1. Escreva uma regra CSS que tenha como alvo o elemento h2 e defina sua cor.
  2. Escreva uma regra CSS que tenha como alvo o elemento p e aplique uma cor de texto legível.

3. Estilize a imagem

  1. Escreva uma regra CSS que tenha como alvo o elemento img.
  2. Defina sua width como 40vw para torná-la responsiva.
  3. Use float: right; para posicioná-la ao lado do texto.
  4. Adicione uma margem de 10px para criar espaçamento ao redor da imagem.

Experimente você mesmo

<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 as lições de Styling with CSS