Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

214
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda