473,785 Members | 2,221 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Floated images and implied paragraphs

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
the same problem would happen with CSS):

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Change d behaviour in Opera 7.21</title>
</head>
<body>

<h3>Floated left image but no paragraph tags on text.</h3>

<img src="animage.jp g" alt="" height="100" width="100" align="left">
The text of the paragraph.<br clear="all">
<h3>Floated left image inside paragraph tags</h3>

<p><img src="animage.jp g" alt="" height="100" width="100" align="left">
The text of the paragraph.<br clear="all">
</p>

</body>
</html>

This is the sort of code that can easily appear with editors such as GoLive
and it validates. In IE6, Firebird, Safari and Opera up until 7.11 at
least, the end result will be similar for both sections. There is a neat
space under the h3 header and then the top of the left floated images will
be neatly aligned with the top of the text.

In Opera 7.21 things have changed. The first image slams up right under the
<h3>...</h3> and there is no longer any alignment between the image and the
text. They have either simply ********** up the positioning of the floated
image somehow, in which case it is just a whopper of a bug, or perhaps they
have decided that the implied <p>...</p> around the paragraph text (if that
indeed is how UAs interpret the code) only kicks in after the <img> instead
of before.

So the question is really, even if it wasn't what they intended, could the
Opera 7.21 interpretation be considered as equally 'correct'.
Jul 20 '05 #1
1 2397
Graham J wrote:

[snip]
<h3>Floated left image but no paragraph tags on text.</h3>

<img src="animage.jp g" alt="" height="100" width="100" align="left">
The text of the paragraph.<br clear="all">
<h3>Floated left image inside paragraph tags</h3>

<p><img src="animage.jp g" alt="" height="100" width="100" align="left">
The text of the paragraph.<br clear="all">
</p> [snip] In IE6, Firebird, Safari and Opera up until 7.11 at least, the end result
will be similar for both sections. There is a neat space under the h3
header and then the top of the left floated images will be neatly aligned
with the top of the text.

In Opera 7.21 things have changed. The first image slams up right under
the <h3>...</h3> and there is no longer any alignment between the image
and the text. They have either simply ********** up the positioning of
the floated image somehow, in which case it is just a whopper of a bug, or
perhaps they have decided that the implied <p>...</p> around the paragraph
text (if that indeed is how UAs interpret the code) only kicks in after
the <img> instead of before.
There's no implied paragraph, although there is an anonymous block box. To
me, it looks like a bug in Opera, as setting an explicit bottom-margin on
the <h3> elements cures it.
[snip] So the question is really, even if it wasn't what they intended, could the
Opera 7.21 interpretation be considered as equally 'correct'.


I don't see how. You'll probably find that using a transitional doctype
will mean that Opera will intentional break from spec. anyway, so it's not
really useful to track these bugs down - if you want accurate results with
CSS, use "Strict Mode" (although in this case, it makes no difference).

(Note followups).

--
Jim Dabell

Jul 20 '05 #2

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

Similar topics

2
2875
by: Ney André de Mello Zunino | last post by:
Hello. The issue is quite known: you have a block-level container holding a set of floated elements and you need that the container's content height take the floated elements' dimensions into consideration. E.g.: <div class="images"> <div class="image"><img src="example1.png" width="160" height="120" alt=""></div> <div class="image"><img src="example2.png" width="160" height="120"
2
2773
by: Wiz | last post by:
Greetings the group! I see from a few previous postings that I am not the only person having a problem with hidden list item bullets. This question applies to both IE 6, current version, and Firefox 0.8 browsers, which I am using for testing. I have a design in progress that uses a relatively positioned, left-floated, 122px wide navbar, with the main content padded to the right by 10px, wrapping under after it exceeds the height of the...
3
5013
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 height:auto) the larger div doesn't seem to see the nested divs, and they spill out the bottom. IE seems to automatically resize the larger div as long as I set the height to 100% or any pixel size. Mozilla doesn't recognize the percent, and...
6
2035
by: Michael Rozdoba | last post by:
I've tried to apply something along the lines of http://www.spartanicus.utvinternet.ie/test/caption_sized_to_image.htm to a floated span containing an image & caption, but I can't find anything that'll work in IE - floating seems to break it. Can it be done without having to specify each image's width explicitly? The best related info I could find was posted here a few days ago, but doesn't seem to work with floats in IE, unless I'm...
1
4052
by: Marek Mänd | last post by:
I have question regarding (clearing) floats and margin-top on DL and HR elements. http://www.hot.ee/idaliiga/testcases/dl/language-chosing-selector.htm Namely the IE6 doesnt calculate the margin-top on the DL (definition list) element correctly. It starts to add topmargin at current fontsizes and layout when i tell him to have 38px topmargin. Can this be fixed somehow to normal?
16
3477
by: Woodmon | last post by:
I want to flow text in an "irregular" column on the left and place a large image at the top of an "irregular" column to the right. Then after the bottom of the large image I want the text column on the left to expand part way to the right, but not all the way to the right, as I want a smaller image on the right. Then this will continue to the bottom of the page. The text needs to flow down in the left column. And the right edge of the...
61
4757
by: phil-news-nospam | last post by:
Why does SVG need a different tag than other images? IMHO, SVG should be implemented as an image type just like any other image type, allowing it to work with <img> tags, and ... here is the important part ... also work with backgrounds in other tags. I fail to see any wisdom in making SVG different than say PNG (of course the implementation of the rendering code would obvious be different). --
9
2612
by: Daniel Kabs | last post by:
Hello there again! On my quest to remove layout tables in favor of CSS controlled elements, I am faced with quite a problem. A table cell that has no explicit width attribute set usually adapts its width to accommodate the content nicely. This is not the case when the content contains floats. I guess floats do not contribute to the table cell width as floated elements are taken out
5
13381
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL http://mghospedagem.com/images/controlpanel.jpg instead of http://mghospedagem.comhttp://mghospedagem.com/images/controlpanel.jpg As u see, there's the website URL before the image URL.
0
10356
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
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...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
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...
0
6744
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
5396
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...
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
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.