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.

Spacing problem

Featured Replies

Hi,

 

I am having a problem with a site I'm designing for a course project. In my page editor the lay out is fine, and it did used to work in a browser but now the "advert" div has moved down too far on all of the pages. I've tried adjusting the CSS but not having any luck. Can any one help me put it back to the top?

 

View the page

 

/* CSS Document */

body {font-family:Georgia, "Times New Roman", Times, serif;}

h1 p {margin-left:20px;}

h1 {font-size:24px;}

#content {padding:15px; margin-left:20px; height:700px; float:left; width:900px;}

#navbar {background-color:E6E6E6;}

#leftbar {float:left; width:200px; height:700px; color:#FF33FF;}

#leftbar li {list-style:none; padding-left:0.5em; }

#advert {float:right; padding:10px; height:700px; width:200px;}

a:links {color:#FF33FF;}

a:visited {color:#FF33FF;}

Your wrapping the image with <p> tags which is adding a space at the top of the first image making it push the content down.

 

take the p tags off and maybe a bottom margin on the images to space them out.

  • Author

Hey thanks for the help.

I tried that, this is a silly thing but I've gone blank on how to add a bottom margin to the images through html?

 

It didn't change though when I opened it in Mozilla, in Safari it's still fine. It annoys me because it was fine the other day and I haven't edited the page layout from what I can remember, for it to change. hmm.

 

It needs sorting before I hand in my project though. Oh the joys of learning :blink::huh:

In your css you would add something like:

 

img {
  margin-bottom:5px;
}

Or you could create a class to target only one specific image, like so:

 

.advert {
 margin-bottom:5px;
}

 

If using a class with a classname of 'advert' as with the example above, you would need to add class="advert" in your image tag, i.e <img src="blah" class="advert">

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.