Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Cascading Style Sheets _ Unwanted space above and on the sides my header

Posted by: jjordan33 Jan 18 2020, 05:52 PM

Hi, I have a header that I want to be at the very tip top, with no space above it, and to stretch the full width of the screen with no space on the sides. However, that is not what I have.

CODE
header {
    margin-top: 0;
    width:100%;
    background-color:#B7D39E;
}

Posted by: pandy Jan 19 2020, 03:41 AM

You must also get rid of the margin or padding browsers add by default to BODY. See this FAQ entry.
https://htmlhelp.com/faq/html/effects.html#no-margins
Ignore the margintop and so on. That's very outdated. CSS is enough.

Posted by: jjordan33 Jan 19 2020, 02:10 PM

Thank you. That took care of it.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)