473,387 Members | 1,485 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Floated div problem

Can anyone see what's wrong with this page:
http://www.simpleservicesonline.co.u...?CategoryID=1? The
first image on the second row budges one to the right leaving a space,
whereas, using the same ASP code to generate the html on all the other
pages works fine and gives me three images per row.

http://www.simpleservicesonline.co.u...p?CategoryID=2
http://www.simpleservicesonline.co.u...p?CategoryID=3 etc

It's starting to drive me mad, so any help would be appreciated (and a
relief)

:)

Mike

Jan 15 '07 #1
2 1630
On 2007-01-15, Mike <pa*******@hotmail.comwrote:
Can anyone see what's wrong with this page:
http://www.simpleservicesonline.co.u...?CategoryID=1? The
first image on the second row budges one to the right leaving a space,
whereas, using the same ASP code to generate the html on all the other
pages works fine and gives me three images per row.

http://www.simpleservicesonline.co.u...p?CategoryID=2
http://www.simpleservicesonline.co.u...p?CategoryID=3 etc

It's starting to drive me mad, so any help would be appreciated (and a
relief)
The problem is not all your images are the same heights, in particular
the first one is 123px high, more than most of the others which are
122px.

The first image on the second row can't go all the way to the left,
because the bottom edge of the very first image is hanging down a couple
of pixels.

If a left float doesn't fit to the right of all the other left floats,
it goes down by just enough to allow it to fit to the right of
something-- which might be another float rather than the left of the
container. This has been described as floats "catching" or "snagging" on
each other. If you want to see the effect, exaggerate the differences in
height and it should be clear what's going on.

$ identify mem*.jpg

mem2pp1.jpg JPEG 100x123 DirectClass 33kb
mem2pp2.jpg[1] JPEG 101x122 DirectClass 34kb
mem2pp3.jpg[2] JPEG 101x122 DirectClass 35kb
mem2pp4.jpg[3] JPEG 101x122 DirectClass 33kb
mem2pp5.jpg[4] JPEG 101x122 DirectClass 32kb
mem2pp6.jpg[5] JPEG 101x122 DirectClass 34kb
mem2pp7.jpg[6] JPEG 101x122 DirectClass 32kb
mem2pp8.jpg[7] JPEG 101x122 DirectClass 31kb
mem2pp9.jpg[8] JPEG 101x121 DirectClass 35kb

You could add a height: 123px to your .temp selector, so each float is
the same height, which may be slightly taller than the image inside it,
or process the images themselves to make sure they are all the same
height.
Jan 15 '07 #2

Ben C wrote:
On 2007-01-15, Mike <pa*******@hotmail.comwrote:
Can anyone see what's wrong with this page:
http://www.simpleservicesonline.co.u...?CategoryID=1? The
first image on the second row budges one to the right leaving a space,
whereas, using the same ASP code to generate the html on all the other
pages works fine and gives me three images per row.

http://www.simpleservicesonline.co.u...p?CategoryID=2
http://www.simpleservicesonline.co.u...p?CategoryID=3 etc

It's starting to drive me mad, so any help would be appreciated (and a
relief)

The problem is not all your images are the same heights, in particular
the first one is 123px high, more than most of the others which are
122px.

The first image on the second row can't go all the way to the left,
because the bottom edge of the very first image is hanging down a couple
of pixels.

If a left float doesn't fit to the right of all the other left floats,
it goes down by just enough to allow it to fit to the right of
something-- which might be another float rather than the left of the
container. This has been described as floats "catching" or "snagging" on
each other. If you want to see the effect, exaggerate the differences in
height and it should be clear what's going on.

$ identify mem*.jpg

mem2pp1.jpg JPEG 100x123 DirectClass 33kb
mem2pp2.jpg[1] JPEG 101x122 DirectClass 34kb
mem2pp3.jpg[2] JPEG 101x122 DirectClass 35kb
mem2pp4.jpg[3] JPEG 101x122 DirectClass 33kb
mem2pp5.jpg[4] JPEG 101x122 DirectClass 32kb
mem2pp6.jpg[5] JPEG 101x122 DirectClass 34kb
mem2pp7.jpg[6] JPEG 101x122 DirectClass 32kb
mem2pp8.jpg[7] JPEG 101x122 DirectClass 31kb
mem2pp9.jpg[8] JPEG 101x121 DirectClass 35kb

You could add a height: 123px to your .temp selector, so each float is
the same height, which may be slightly taller than the image inside it,
or process the images themselves to make sure they are all the same
height.
Thanks Ben - I never thought to look at the height of the images.
They come from another source, which I thought I had some control over
(in that I asked for them to be identical dimensions). Given that my
request obviously was ignored (or not understood), I have set a height
for the selector as you suggested. Works as I want now.

Jan 15 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Graham J | last post by:
I submitted a variation on this on the Opera forum but I thought I'd bring it up here too as a more general HTML query. Consider this code (I've shown it the old fashioned presentational way but...
6
by: Zaka Ferenc | last post by:
Hi all, the page http://info.etr.elte.hu/divtest5.html looks as I expected in IE6 and Opera 7.11, but the floated divs float out of the containing blocks (divs) in NN7.1 and Opera 7.0 (what I...
4
by: boclair | last post by:
Is this a known problem with IE6? I have a provisional two column layout, the left menu column is positioned absolute. The contents column is positioned relative. The contents column has an...
3
by: Alison Stewart | last post by:
A perennial problem; apologies if people are sick of this one. I have a dynamic-width page with stripes on the left and the right; the left stripe is defined in "body {background:}", while the...
26
by: puzzled | last post by:
Okay, so my subject sounds a bit crass. As much as I'd like to totally embrace css and avoid "deprecated" usage, sometimes the deprecated stuff is so much easier and more effective. Plus, it at...
3
by: Philip | last post by:
I am trying to make a bunched of left-floated divs that will be contained in a larger div. the floated divs all contain a left-floated img and text of varying sizes. If I don't set a height (or...
3
by: Lee K. Seitz | last post by:
I'm redesigning this page for more up-to-date browser standards: <http://home.hiwaay.net/~lkseitz/hhs/winners.shtml>. Note the use of an "invisible" table to position the "visible" ones. I'm...
24
by: Thomas Mlynarczyk | last post by:
Hi, Here's what I have: <div> <img ...><br> Caption text </div> The div is floated left and has no width set, the content is centered, there are no margins or padding on the <img> (just a...
4
by: Matt | last post by:
Hi, Got an unordered list with 100% width, with 5 list items of 20% width styled to fill the width of the container element. Renders fine in Mozilla, but when you change the size of the window...
1
by: alex | last post by:
Hey all, May have missed this in the FAQ, advice or article links welcome. Have a content div with a navigation div floated left and an advertisement div floated right. I would like to have a...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.