-1

What kind of CSS styling can I add so that my header begins directly on the top of the page? For now there is always some space between the header and the page beginning.

<div class="page-header">
  <h1>Title</h1>
</div>

1
  • Can you please show us what you've tried so far ? Commented Jan 13, 2020 at 17:05

2 Answers 2

0

This might work.

body {
  margin: 0;
  padding: 0;
}
<div class="page-header">
  <h1>Title</h1>
</div>

Sign up to request clarification or add additional context in comments.

Comments

0

Try to add:

.page-header h1 {
  margin-top: 0;
  margin-bottom: 0;
}
<div class="page-header">
  <h1>Title</h1>
</div>

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.