sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
Olav Tollefsen's Avatar

Why unwanted space?


Question posted by: Olav Tollefsen (Guest) on July 24th, 2005 01:44 AM
Take a look at:

http://www.baldrian.no/HtmlPage.htm

Why does the browser render some unwanted space (showing the background
color) below the buttons (image) and above the blue cell?

How can I get rid of it?

Olav


9 Answers Posted
Blinky the Shark's Avatar
Blinky the Shark July 24th, 2005 01:44 AM
Guest - n/a Posts
#2: Re: Why unwanted space?

Olav Tollefsen wrote:
[color=blue]
> Take a look at:[/color]
[color=blue]
> http://www.baldrian.no/HtmlPage.htm[/color]
[color=blue]
> Why does the browser render some unwanted space (showing the background
> color) below the buttons (image) and above the blue cell?[/color]

What is "the browser"?

--
Blinky Linux Registered User 297263
Killing all Usenet posts from Google Groups
Info: http://blinkynet.net/comp/uip5.html
*ALSO contains links for access to the NON-BETA GG archive interface*
Volkm@r's Avatar
Guest - n/a Posts
#3: Re: Why unwanted space?

Olav Tollefsen wrote:[color=blue]
> Take a look at:
>
> http://www.baldrian.no/HtmlPage.htm[/color]

Oops ...
<http://www.htmlhelp.com/cgi-bin/validate.cgi?url=http%3A%2F%2Fwww.baldrian.no%2FHt mlPage.htm&warnings=yes>
<http://validator.w3.org/check?uri=http%3A%2F%2Fwww.baldrian.no%2FHtmlPage. htm&charset=%28detect+automatically%29&verbose=1>

Please get that fixed first and come back later.
[color=blue]
> Why does the browser render some unwanted space (showing the background
> color) below the buttons (image) and above the blue cell?[/color]

Without having seen that page, I guess this is one of our most basic
standard questions.
<http://developer.mozilla.org/en/docs/Images,_Tables,_and_Mysterious_Gaps>

[color=blue]
> [...][/color]
--
Volkm@r
twaddle's Avatar
Guest - n/a Posts
#4: Re: Why unwanted space?

Olav Tollefsen wrote
[color=blue]
> http://www.baldrian.no/HtmlPage.htm[/color]
[color=blue]
> Why does the browser render some unwanted space (showing the
> background color) below the buttons (image)[/color]

Having seen the page I'd say it's because of the image map. Try to move
the map, not the image, outside the table.

That said, isn't XHTML 1.1 a little over the top with a table layout
and the document served as text/html? Why do you use that doctype?

Jim Moe's Avatar
Guest - n/a Posts
#5: Re: Why unwanted space?

Olav Tollefsen wrote:[color=blue]
>
> Why does the browser render some unwanted space (showing the background
> color) below the buttons (image) and above the blue cell?
>
> How can I get rid of it?
>[/color]
Try setting the margin and padding of the <img> to 0.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
twaddle's Avatar
Guest - n/a Posts
#6: Re: Why unwanted space?

Jim Moe:[color=blue]
> Try setting the margin and padding of the <img> to 0.[/color]

Why? AFAIK browsers don't add either margin or padding to images by
default.

Jim Moe's Avatar
Guest - n/a Posts
#7: Re: Why unwanted space?

twaddle wrote:[color=blue]
>[color=green]
>>Try setting the margin and padding of the <img> to 0.[/color]
>
> Why? AFAIK browsers don't add either margin or padding to images by
> default.
>[/color]
Yes, you are correct. I did not actually try the suggestion.
The browser is adding space/margin/padding below the image for no
observable reason. I have solved this problem before but have forgotten
what the solution is.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Alan J. Flavell's Avatar
Alan J. Flavell July 25th, 2005 08:15 PM
Guest - n/a Posts
#8: Re: Why unwanted space?

On Mon, 25 Jul 2005, Jim Moe wrote:
[color=blue]
> The browser is adding space/margin/padding below the image for no
> observable reason.[/color]

It's called the CSS specification. By default, in standards mode,
inline objects such as img are positioned on the font baseline,
leaving room below for descenders.

In many cases this can be avoided by using CSS to set vertical align
for img to "bottom" instead.

But in this case I'd have to counsel against using images that are
nothing more than images of text. This page is not only unfriendly to
unusual display situations, but fails a number of WAI criteria. Let
text be text, and propose a presentation using CSS. I don't care for
the look of the source code - if I had to deal with this I think I'd
rip out all the markup and start again using current good practice.
It looks like some relic from HTML3.2, complete with HTML syntax
errors (which is why I didn't bother to comment on it when originally
posted).

best regards
Sandman's Avatar
Guest - n/a Posts
#9: Re: Why unwanted space?

In article <42e2ab0c$1@news.broadpark.no>, "Olav Tollefsen" <x@y.com> wrote:
[color=blue]
> Take a look at:
>
> http://www.baldrian.no/HtmlPage.htm
>
> Why does the browser render some unwanted space (showing the background
> color) below the buttons (image) and above the blue cell?
>
> How can I get rid of it?[/color]

Can't tell you exactly why, but it's because of the doctype. Remove the doctype
and the gap is removed. Check it out:

http://www.sandman.net/misc/baldrian.html

--
Sandman[.net]
Jedi Fans's Avatar
Guest - n/a Posts
#10: Re: Why unwanted space?

Sandman wrote:[color=blue]
> In article <42e2ab0c$1@news.broadpark.no>, "Olav Tollefsen" <x@y.com> wrote:
>[color=green]
>> Take a look at:
>>
>> http://www.baldrian.no/HtmlPage.htm
>>
>> Why does the browser render some unwanted space (showing the background
>> color) below the buttons (image) and above the blue cell?
>>
>> How can I get rid of it?[/color]
>
> Can't tell you exactly why, but it's because of the doctype. Remove the doctype
> and the gap is removed. Check it out:
>
> http://www.sandman.net/misc/baldrian.html
>[/color]
better yet use the transitional xhtml 1.0 dtd:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-loose.dtd">

it works and is better than no dtd
 
Not the answer you were looking for? Post your question . . .
196,816 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,816 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors