Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Conclusão do Curso

É sempre um deleite fazer as aulas de HTML5 e CSS3. Pois, curto muito esta parte de estilização do site

No meu código final, fiz umas pequenas alterações. E gostaria de saber se tem algum problema de colocar a tag table dentro da tag form?

<!DOCTYPE html>
<html lang="pt-br">
    <head>
        <meta charset="utf-8">
        <title>Contato - Barbearia Alura</title>

        <link rel="stylesheet" href="reset.css">
        <link rel="stylesheet" href="style.css">
    </head>
    <body>
        <header>
            <div class="caixa">
                <h1><img src="logo.png" alt="Logo da Barbearia Alura"></h1>

                <nav>
                    <ul>
                        <li><a href="index.html">Home</a></li>
                        <li><a href="produtos.html">Produtos</a></li>
                        <li><a href="">Contatos</a></li>
                    </ul>
                </nav>
            </div>
        </header>

        <main>
            <form>
                <label for="nomesobrenome">Nome e sobrenome</label>
                <input type="text" id="nomesobrenome" class="input-padrao"required placeholder="Insira seu nome e sobrenome">

                <label for="email">E-mail</label>
                <input type="email" id="email" class="input-padrao" required placeholder="seuemail@dominio.com">

                <label for="telefone">Telefone</label>
                <input type="tel" id="telefone" class="input-padrao" required placeholder="(XX) XXXXXX-XXXX">

                <label for="mensagem">Mensagem</label>
                <textarea cols="60" rows="10" id="mensagem" class="input-padrao"></textarea required>

                <fieldset>
                    <legend>Como prefere o nosso contato?</legend>
                    <label for="radio-email"><input type="radio" name="contato" value="email" id="radio-email">E-mail</label>

                    <label for="radio-telefone"><input type="radio" name="contato" value="telefone" id="radio-telefone">Telefone</label>

                    <label for="radio-whatsapp"><input type="radio" name="contato" value="whatsapp" id="radio-whatsapp" checked>WhatsApp</label>

                </fieldset>

                <fieldset>
                    <legend>Qual horário prefere ser atendido?</legend>
                    <select>
                        <option>Manhã</option>
                        <option>Tarde</option>
                        <option>Noite</option>
                    </select>
                </fieldset>
            <br>    
            <table>
                <thead>
                    <legend class="funcionamento">Horário de funcionamento</legend>
                    <tr>
                        <th>Dia</th>
                        <th>Horário</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>Segunda</td>
                        <td>8h ~ 20h</td>
                    </tr>
                    <tr>
                        <td>Quarta</td>
                        <td>8h ~ 20h</td>
                    </tr>
                    <tr>
                        <td>Sexta</td>
                        <td>8h ~ 20h</td>
                    </tr>
                </tbody>
            </table>

                <label class="checkbox"><input type="checkbox" checked>Gostaria de receber nossas novidades por e-mail?</label>

                <input type="submit" value="Enviar Formulário" class="enviar">

            </form>


        </main>

        <footer>
            <img src="logo-branco.png" alt="Logo da Barbearia Alura">
            <p class="copyright">© Copyright Barbearia Alura 2022</p>    

        </footer>
    </body>
</html>

    Código CSS
header{
    background: #BBBBBB;
    padding: 20px 0;
}

.caixa{
    position: relative;
    width: 940px;
    margin: 0 auto;
}

nav{
    position: absolute;
    top: 110px;
    right: 0;
}

nav li{
    display: inline;
    margin: 0 0 0 15px;
}

nav a{
    text-transform: uppercase;
    color: #000000;
    font-weight: bold;
    font-size: 22px;
    text-decoration: none;
}

nav a:hover {
    color: #C78C19;
    text-decoration: underline;
}

.produtos {
    width: 940px;
    margin: 0 auto;
    padding: 50px 0;
}

.produtos li {
    display: inline-block;
    text-align: center;
    width: 30%;
    vertical-align: top;
    margin: 0 1.5%;
    padding: 30px 20px;
    box-sizing: border-box;
    border: 2px solid #000000;
    border-radius: 10px;
}

.produtos li:hover {
    border-color: #C78C19;
}

.produtos li:active {
    border-color: #088C19;
}

.produtos li:hover h2 {
    font-size: 34px;
}
.produtos h2 {
    font-size: 30px;
    font-weight: bold;
}

.produto-descricao {
    font-size: 18px;
}

.produto-preco {
    font-size: 22px;
    font-weight: bold;
    margin-top: 10px;
}
footer {
    text-align: center;
    background: url("bg.jpg");
    padding: 40px 0;
}

.copyright {
    color: #FFFFFF;
    font-size: 13px;
    margin-top: 20px;
}
main { 
    width: 940px;
    margin: 0 auto;
}
form {
    margin: 40px 0;
}
form label, form legend{
    display: block;
    font-size: 20px;
    margin: 0 0 10px;
}
.input-padrao {
    display: block;
    margin: 0 0 10px;
    padding: 10px 25px;
    width: 50%;
}
.funcionamento {
    margin: 10px auto;
    font-size: 23px;
}
.checkbox {
    margin: 20px 0;
}
.enviar {
    width: 40%;
    padding: 15px 0;
    background: orange;
    color: white;
    font-weight: bold;
    font-size: 18px;
    border: none;
    border-radius: 5px;
    transition: 1s all;
    cursor: pointer;
}
.enviar:hover {
    background: darkorange;
    transform: scale(1.2);
}
table {
    margin: 20px 40px;
}
thead {
    background: #555555;
    color: white;
    font-weight: bold;
}
th, td {
    border: 1px solid #000000;
    padding: 8px 15px;
}
2 respostas
solução!

Oi Gabriel, tudo bem?

Parabéns por concluir o curso e pelo projeto final! Espero que tenha gostado da experiência de aprendizado.

Acredito que não seja semânticamente correto colocar a tag table dentro do form, pois ele já tem uma estrutura básica.

<form action="" method="get" class="form-example">
  <div class="form-example">
    <label for="name">Enter your name: </label>
    <input type="text" name="name" id="name" required>
  </div>
  <div class="form-example">
    <label for="email">Enter your email: </label>
    <input type="email" name="email" id="email" required>
  </div>
  <div class="form-example">
    <input type="submit" value="Subscribe!">
  </div>
</form>

Assim como a tag table tem sua estrutura básica.

Deixo aqui duas documentações para você dar uma olhadinha:

Então é uma questão de boas práticas usar a estrutura certa para o que você quer fazer.

Um abraço e bons estudos.

Entendi! É que eu gosto de fazer firulas na estilização, porquê gosto muito da estética da página. Vou dar uma estudada nessas documentações que você me enviou... Muito obrigado pelas dicas, Lorena!

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software