html - how can i get rid of space above the header -


how can rid of space between top of webpage , header?
code:

body {      margin: 0px;      padding: 0px;  }            #header {      background-image: url(space.jpg);      color: white;      font-size: 40px;      text-align: center;      height: 70px;      margin-top: 0px;  }
<div id="header">    <p> weird title </p>  </div>    <a href ="practice.html"> click here </a>

i tried margin-top doesn't work there doing wrong.

you have apply margin-top: 0 rule p element inside #header div, margin being created p element instead of div.

as tip, can check these kinds of issues using developer tools on browser, selecting element , checking border / margin / padding values on right pane.

#header > p {     margin-top: 0 } 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -