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
Post a Comment