Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

header and footer in CSS - gap around edges?

Featured Replies

Hey,

 

I'm in the process of trying to redevelop my site - I'm a bit new to CSS so if this sounds trivial please forgive me.

 

The problems I'm having concern my header bar and my footer (you can see the current state of the page here)

 

Basically, I want a black bar across the top of the page (61px high with the border on the bottom edge) and the same across the bottom of the page (with a border on the top but high enough to contain all the info).

 

My CSS code so far is:

 

#header_bar {
margin: 0px;
background-color: #000000;
border-bottom-style: solid;
border-color: #FF6600;
border-width: 0px 0px 3px 0px;
height: 61px;
}
#footer_bar {
margin: 0px;
background-color: #000000;
border-top-style: solid;
border-color: #FF6600;
bottom: 0px;
border-top-width: 3px;
}

 

The issues:

1) There's a border around the header div that I have no idea how to get rid of

2) The footer bar appears at the bottom of the content, and I've no idea how to anchor it to the bottom

 

I've been going round and round with this all day and I'm not sure what I'm doing wrong? Any help on these would be much appreciated!

 

Thanks,

 

Adam.

  • Author

Add

 

*{margin:0; padding:0;}

 

to the top of your css

 

and have a look here for your footer

 

Do I add the

*{margin:0; padding:0;}

into the '#header' ID or do I just place it at the top of my CSS document?

 

The link for the footer looks perfect, thanks a lot for that!

 

Adam.

  • Author

Do I add the

*{margin:0; padding:0;}

into the '#header' ID or do I just place it at the top of my CSS document?

 

The link for the footer looks perfect, thanks a lot for that!

 

Adam.

 

Actually, scratch that, I've pasted it in and it works great, thanks again!

 

Adam.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.