473,769 Members | 4,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem aligning with float and clear

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. +-------+
| |
+-------+

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.
Oct 14 '05 #1
0 1396

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

Similar topics

4
5728
by: Florian Brucker | last post by:
Hi! I've got a problem with float & clear. Take this example code: <div style=" width:100px; height:100px; background-color:#FF0000; float:left; margin:10px;"></div> <span style="clear:left;">This is some text</span> In Mozilla 1.6 the span still floats around the image on the left side (as if there wasn't a "clear" option). When I use
10
4649
by: NoSpan | last post by:
I have this page that has layout like the following: (no frameset) ---------------------------------------- | header | |--------------------------------------| | div1 | div2 | | | | |-------------------| | | div3 | | | | |
3
2432
by: Listerofsmeg | last post by:
Hi all, Is this possible? I have a simple DIV with some text and an image inside. I want the text to wrap around the image, but I want the bottom of the image to sit on the bottom of the DIV. I know the size of the image, but not the size of the DIV. Many thanks Lister
5
2297
by: Chris Beall | last post by:
See http://pages.prodigy.net/chris_beall/BeallSprings/WC.Deed%20GG.116-17.html using the CSS at http://pages.prodigy.net/chris_beall/BeallSprings/BSstyle.css The page is a transcript of a deed. I'm trying to retain, somewhat, the layout of the original document. Below the deed are the signatures (on the right) and the names of witnesses (on the left), hence paired blocks of text.
5
3967
by: Tony | last post by:
I seem to be missing something in my understanding. If I leave off absolute positioning, shouldn't nested DIV/SPAN be displayed inside the parent, and ones outside that display separately? Here is some sample code: ---------------------------------------------------------- <div id='header' style='border:red solid medium'> <p>This is the Header</p> </div>
1
3053
by: books1999 | last post by:
Hi there, I have a problem with this css/div and i cannot work it out. I would like either container to be able to push the background box to grow but in Firefox it overflows. Can someone find a solution to the problem contained in the code. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
19
4780
by: rmr531 | last post by:
First of all I am very new to c++ so please bear with me. I am trying to create a program that keeps an inventory of items. I am trying to use a struct to store a product name, purchase price, sell price, and a taxable flag (a Y/N char) and then write this all out to a file (preferably just a plain old text file) and then read it in later so that I can keep a running inventory. The problem that I am running into is when I write to the...
1
2084
by: donpro | last post by:
Hi, I'm creating a template paging sing pure CSS and all looks good except the footer which I am having problems with. 1) When I space out each of the FOUR DIVS at 25%, it wraps in IE. I hacked it by changing to 24% but don;t know why. 2) I can't get the right border to extend down to the bottom border (both IE and Firefox).
1
3114
by: innivive | last post by:
I am having a problem with having margins display correctly in IE7, Firefox and Safari. I am not sure if it is the "double margin error" or something else. Any help would be appreciated. The file tabs at the top content area should be flush left and the light blue frame should line up under the logo graphic. Looks great in Safari and Firefox but I can't get it to line up in IE7. http://www.thinairdigital.com/tdi Any help would be...
0
9424
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10051
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8879
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.