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.

Can you please tell me why there is spacing at the top of this layout?

Featured Replies

Hi,

 

I'm relatively new to web design, so please bear with me here.

 

The layout I'm currently trying to make has a gap at the top and I can't figure out why it's there. I have used a CSS reset in my stylesheet, making all padding and margins 0.

 

I'm talking about the gap between the header and the very top of the page. If someone could have a quick look to see why the gap is there I'd be very grateful.

 

Thanks.

 

http://mytestingplace.com/

at a guess the <br/> you have here

 

<img id="background" src="images/simplified.jpg" /><br /><!-- Main background -->

Edited by zed

On viewing the page source I found this?

 

<div id="top_margin"></div><!-- Adds a 20 px margin and shadow to top -->

  • Author

On viewing the page source I found this?

 

<div id="top_margin"></div><!-- Adds a 20 px margin and shadow to top -->

 

Hi, yes I see how you'd think that was strange. I have updated the page since zed helped me. I never thought to update this thread to reflect the changes, so I will.

 

This was because I actually intended on having a gap at the top, I just wanted to make sure it was under my control rather than some bug I didn't understand.

 

Thanks.

 

EDIT: Hmm well I can't edit my first post or thread title, but hopefully people will read this.

Edited by happydays

  • Author

A good trick into right click the area in chrome or Firefox and inspect the element.

 

Thanks Mike, I do this with Firefox. Really liking the 3d view also.

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.