HighDots Forums  

Problem aligning with float and clear

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Problem aligning with float and clear in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Paul E Collins
 
Posts: n/a

Default Problem aligning with float and clear - 10-14-2005 , 08:05 AM






Hello.

I want to display a number of individual blocks of text. Each block
has an associated image, which should be displayed on the right and
aligned with the top of its block of text, i.e.
(use a fixed-width font to view this!)

Some short text. +-------+
Quote:
|
+-------+

This one has some +-------+
longer text which | |
will wrap around +-------+
the image on the right.

I'm using this markup for each of the blocks:

<div style="width: 256px; height: 192px; margin-left: 20px; float:
right; clear: right; background-image: url('image.png')">
</div>
<div style="vertical-align: top">
<p>Text to appear on the left</p>
</div>

(The 'background-image' bit is used to achieve a single-image rollover
effect: the 256 x 192 region clips the bottom half of the 256 x 384
image, and onMouseOver shifts the other half into view. Anyway, that's
not the problem.)

The page renders as intended in MSIE, but under Firefox and Safari
(and perhaps other more standards-compliant browsers) the text shifts
up into previous blocks, i.e. "float: right; clear: right" does not
ensure that each subsequent block is clear of the previous one and
aligned with the next corresponding image.

What am I doing wrong here, and how can I correct it?

P.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.