Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

205
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!