Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

212
Visualizações
Does anybody know why my <p> is so far away from the line above it?

css file:

css file

what gets printed:

what gets printed

html file if it even necessary:

html file if it even necessary

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You need to keep in mind that HTML elements come with default styling and each browser is slightly different. Then you need to use the browser developer tools to debug your code. Right click on your HTML element and select inspect.

enter image description here

Now highlighting over your HTML elements will display your margins, border, padding of the selected element, so you can see your h1 has a top and bottom margin applied, remember its default styling applied by the browser.

about 4 years ago · Juan Pablo Isaza Relatório

0

main{
        text-align: center;
    }
    h1{
        font-size:3.5em;
        border-bottom: 2px solid #000;
        display: inline-block;
        padding: 0 10rem;
        margin-bottom: 0
    }
    #aspiration{
        text-align: center;
    }
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
</head>

<body>
    <p></p>
    <main>
        <h1>David Bandas</h1>
    </main>
    <p id="aspiration">Aspiration front-end developer</p>

</body>
</html>

Output:https://i.stack.imgur.com/NEWEr.png

Html tags come with default user agent stylesheet.If you want to change then need to reset this style with your style. You can check this default style,In chrome simply press ctrl + shift + i And select your tag.You can see default css.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda