How can I eliminate space at the top of the page? |
How can I eliminate space at the top of the page? |
Oasis |
Sep 23 2009, 01:15 AM
Post
#1
|
Group: Members Posts: 4 Joined: 23-September 09 Member No.: 9,827 |
Hello
I am trying to create a page for a client and I don't want the space above images and music player. Is it possible to write an html code to remove this space? http://www.freewebs.com/advertiseonline/test.html Kind regards Bev |
pandy |
Sep 23 2009, 01:57 AM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
In your CSS:
CODE body { margin: 0; padding 0 } See http://htmlhelp.com/faq/html/effects.html#no-margins . But you only need the above. The use of proprietary attributes hasn't been needed for many years now. |
Frederiek |
Sep 23 2009, 07:05 AM
Post
#3
|
Programming Fanatic Group: Members Posts: 5,146 Joined: 23-August 06 From: Europe Member No.: 9 |
Your HTML markup has no structure at all. See http://htmlhelp.com/reference/html40/structure.html#doc for an exemple of a complete document.
|
Oasis |
Sep 23 2009, 09:18 AM
Post
#4
|
Group: Members Posts: 4 Joined: 23-September 09 Member No.: 9,827 |
Thank you both. I tried {body { margin: 0; padding 0 } and it works fantastic for Explorer but for FireFox it still leaves space. Do you html gurus know if there are tricks to make it eliminate the space for that browser?
You all are great! Thanks so much! This post has been edited by Oasis: Sep 23 2009, 09:46 AM |
pandy |
Sep 23 2009, 09:32 AM
Post
#5
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Yeah. That's because I'm a klutz. I dropped a colon. Here it is corrected.
CODE body { margin: 0; padding: 0 } Som browsers use padding and some use margin. That's why it still worked in IE that only needs the margin reset. Sorry. |
Oasis |
Sep 23 2009, 11:16 AM
Post
#6
|
Group: Members Posts: 4 Joined: 23-September 09 Member No.: 9,827 |
Thanks Pandy. I tried it again. No luck with firefox eliminating the space. Therefore, I tried
<body marginheight="0" topmargin="0" marginwidth="0" leftmargin="0" style="margin:0;padding:0"> and no luck either. Thank you for your help! Its appreciated. http://www.freewebs.com/advertiseonline/bottombanner.html |
pandy |
Sep 23 2009, 01:00 PM
Post
#7
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
It's because you have placed a P just before OBJECT. P has a top margin in Gecko while it does not in IE.
AFAICS that P is never closed, so almost the whole page in in a paragraph. That's no good. OBJECT isn't allowed inside P either, so you really don't want a P there at all.. You have two BODY tags and some other peculiarities. You need to clean this up a little. The validator can help you with that. Put a doctype on first. http://htmlhelp.com/tools/validator/ |
Oasis |
Sep 24 2009, 10:55 PM
Post
#8
|
Group: Members Posts: 4 Joined: 23-September 09 Member No.: 9,827 |
AHHHH it worked! it worked! Wow thanks soooooooooooo much. I would have never figured that out on my own. I got that free player from a site so I would never think that code would be the culprit. Thank you so much for taking time out to help me.
Your very kind Beverly |
pandy |
Sep 25 2009, 06:03 AM
Post
#9
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
No problem.
Browsers put margins and sometimes padding on most block level elements, so it's often worth while to check that when you get a "gap". DIV is the one block level element you can be sure of isn't styled in any browser (more than just that it is a block). That doesn't mean you should use DIV isntead of P, H(n) and so on, it just means that you don't need to control its margins. |
Lo-Fi Version | Time is now: 23rd April 2024 - 03:26 AM |