[lug] OT: HTML Question (Don't know where else to turn.)

Peter Hutnick peter-lists at hutnick.com
Fri Mar 28 13:22:39 MST 2003


Michael D. Hirsch said:
> On Friday 28 March 2003 12:33 pm, Peter Hutnick wrote:
>> Sorry for being so off-topic.  I hope nobody gets too bent out of
>> shape :-)
>>
>> I'm having trouble with floating images in XHTML 1.0.  If I have two
>> floating images in two different <p>aragraphs I'd expect them to
>> vertically align.  But I find that they stair step instead if there
>> isn't enough text in the paragraph to force the subsequent image down.
>>  See the three images at the bottom of http://hutnick.com .
>>
>> I'm interested in any suggestions that are valid XHTML that will
>> produce the effect I am looking for.
>
> I asked our resident XHTML guru (Meredith Howle) and she says: change
> your  css file to have this line at the end:
>
> IMG.left { float: left ; clear: left;}

I'll give that a shot.  Right now it is working at
http://hutnick.com/test.html.  Kenneth got me thinking about (and
researching) <div>s.  Turns out that sticking <div class="something" />
between the paragraphs does the trick if your CSS says DIV.something {
clear: both; }.

Both answers seem to be different ways of getting around the same idea.  I
think Meredith's is the more technically adroit.

Note to self.  Before using a <div> (and especially a <div . . . />) see
if there is a way to do the same thing in a tag that you actually need!

Thanks for the help, guys.  This list rocks!

-Peter





More information about the LUG mailing list