Click here to get back home

Space around images?

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Space around images? Olav 11-21-2007
Get Chitika Premium
Posted by cf on November 21, 2007, 6:55 pm
Please log in for more thread options
let it be known on Wed, 21 Nov 2007 22:29:20 +0100

|Why does this result in whitespace between the images?
|
| <div style="border-width: 0px; padding: 0px; margin: 0px;">
| <img src="images/logo.gif" width="150" height="66"
|alt="" />
| </div>
| <div style="border-width: 0px; padding: 0px; margin: 0px">
| <img src="images/logo.gif" width="150" height="66"
|alt="" />
| </div>
|Olav
|

Another try, test2.htm
<http://www.cnswebs.net/stuff/olav/test2.htm>

This one seems to work in FF2, IE7 and Opera9 by setting the height of the
containing divisions to the height of the images.

Hopefully someone else may have a better solution for you as I don't like
setting the height of the divisions as it sometimes causes other problems making
the page break.

hth
--
I may be dumb, but I'm not stupid.
Terry Bradshaw

Posted by Jonathan N. Little on November 21, 2007, 9:23 pm
Please log in for more thread options
cf wrote:
> let it be known on Wed, 21 Nov 2007 22:29:20 +0100
>
> |Why does this result in whitespace between the images?
> |
> | <div style="border-width: 0px; padding: 0px; margin: 0px;">
> | <img src="images/logo.gif" width="150" height="66"
> |alt="" />
> | </div>
> | <div style="border-width: 0px; padding: 0px; margin: 0px">
> | <img src="images/logo.gif" width="150" height="66"
> |alt="" />
> | </div>
> |Olav
> |
>
> Another try, test2.htm
> <http://www.cnswebs.net/stuff/olav/test2.htm>
>
> This one seems to work in FF2, IE7 and Opera9 by setting the height of the
containing divisions to the height of the images.
>
> Hopefully someone else may have a better solution for you as I don't like
setting the height of the divisions as it sometimes causes other problems making
the page break.


No need for the 2nd DIV

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="content-language" content="en-us">
<title>Simple</title>

<style type="text/css">
body { margin: 0; padding: 0; }
.stackem { margin: 0; padding: 0; }
.stackem img { display: block; }
</style>


</head>
<body>

<div class="stackem">
<img src="http://www.cnswebs.net/stuff/olav/logo1.gif" width="150"
height="66" alt="upper">
<img src="http://www.cnswebs.net/stuff/olav/logo2.gif" width="150"
height="66" alt="lower">
</div>

</body>
</html>

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Posted by cf on November 21, 2007, 10:24 pm
Please log in for more thread options
let it be known on Wed, 21 Nov 2007 21:23:05 -0500

<snipped>
|
|No need for the 2nd DIV
|
|<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
| "http://www.w3.org/TR/html4/strict.dtd">
|<html>
|<head>
|<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
|<meta http-equiv="content-language" content="en-us">
|<title>Simple</title>
|
|<style type="text/css">
|body { margin: 0; padding: 0; }
|.stackem { margin: 0; padding: 0; }
|.stackem img { display: block; }
|</style>
|
|
|</head>
|<body>
|
|<div class="stackem">
|<img src="http://www.cnswebs.net/stuff/olav/logo1.gif" width="150"
|height="66" alt="upper">
|<img src="http://www.cnswebs.net/stuff/olav/logo2.gif" width="150"
|height="66" alt="lower">
|</div>
|
|</body>
|</html>

Yes, I realize the second div is not needed, but since the OP had each image in
its own div I thought there may be a reason he wanted each to have its own div.

Happy Turkey Day!
--
I may be dumb, but I'm not stupid.
Terry Bradshaw

Similar ThreadsPosted
Space introduced between images October 13, 2004, 2:26 pm
make a div take up space August 21, 2004, 7:33 am
Why unwanted space? July 23, 2005, 10:39 pm
SSI Nav Menu Space February 20, 2007, 12:38 pm
Bold takes up more space? July 13, 2004, 10:35 am
Why Blank Space on Last Row of Table? July 29, 2004, 3:00 am
Zero width space still unsafe? December 20, 2004, 4:46 pm
why paragraphs have a space on top in FireFox? May 19, 2005, 11:30 am
adding white space in

August 31, 2005, 4:34 pm
White space, collapsing March 28, 2006, 10:47 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap