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
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*
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
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?
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)
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.
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)
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
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]
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
|
|
|
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.
Top Community Contributors
|