Help - Search - Members - Calendar
Full Version: images
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
Hi can i get some help with this html page. I dont want an area around the banner (the White area in the left side and top)

heres the code that page

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>The Gold mantle</TITLE>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 11.00.9600.18163"></HEAD>
<P><IMG border=0 hspace=0 alt=""
src="C:\Users\Allan\Desktop\The Gold mantle\banner.gif" border="0"
<br><P align=center>Welcome to the Gold mantle. Home of the webcomics Ebernezer and
HC. Andersens episke liv og levned </P></BODY></HTML>

the image im talking about

Click to view attachment
Christian J
That's probably caused by the P element's default margin, maybe also the BODY's default margin/padding. I only think you can remove it with CSS, see the link on top of this page for an introduction.

BTW, you're not using frames are you? They cause a lot more trouble than they're worth.
See . You only need the CSS bit, style="margin:0;padding:0" and you are better off putting it in an external style sheet or in a style block in HEAD (see Christian's link for that), but this will work too. The rest is for browsers that are so old no one uses them anymore.
Christian J
QUOTE(pandy @ Jan 22 2016, 12:20 AM) *

That just removes the BODY margin though. The P elements top margin still remains.

Another problem: since the image has a fixed width, it will only fit in browser windows of the exact same width; otherwise there will be a white area to the right, or a horizontal scrollbar in narrow windows.

As a sidenote you should also provide ALT text for the IMG element (for search engines and other non-visual users), and it's more beneficial to use a heading element like H1 instead of P for a logo image like that (the same margin issues still apply).
QUOTE(Christian J @ Jan 22 2016, 12:29 AM) *

That just removes the BODY margin though.

Yes and I showed the OP how to do that.

The P elements top margin still remains.

Maybe there is a P margin in some other browser, but not the one used for the screen cap.
Christian J
The following post can be safely ignored by the thread starter. smile.gif

QUOTE(pandy @ Jan 22 2016, 01:58 AM) *

Maybe there is a P margin in some other browser, but not the one used for the screen cap.

You're right, it seems the quirksmode Doctype removes it in most browsers. But if the OP would use a standards mode Doctype the margin should reappear.
I didn't try. But the left and top gap are of equal size so it should be the body padding.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.