473,473 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

205px image in a 200px div

Jim
Should the browser increase the div to 205px? or overflow the image?
Reading the spec http://www.w3.org/TR/CSS21/visufx.html it makes no
reference to inline-replaced elements though I'd assume that it behaves
in the same way as a block-level box.

Can anyone confirm?

Ta,

Jim.

Aug 2 '06 #1
3 1608
Jim wrote:
Should the browser increase the div to 205px? or overflow the image?
Reading the spec http://www.w3.org/TR/CSS21/visufx.html it makes no
reference to inline-replaced elements though I'd assume that it behaves
in the same way as a block-level box.
As inline-replaced elements are still inline elements they exists
inside line boxes, therefore the first bullet point seems to apply.

"A line cannot be broken, causing the line box to be wider than the
block box."

As you can't break a line inside an image, the line box containing the
image will be wider than the block box. So overflow occurs.

Steve

Aug 2 '06 #2
Jim

Steve Pugh wrote:
Jim wrote:
Should the browser increase the div to 205px? or overflow the image?
Reading the spec http://www.w3.org/TR/CSS21/visufx.html it makes no
reference to inline-replaced elements though I'd assume that it behaves
in the same way as a block-level box.

As inline-replaced elements are still inline elements they exists
inside line boxes, therefore the first bullet point seems to apply.

"A line cannot be broken, causing the line box to be wider than the
block box."

As you can't break a line inside an image, the line box containing the
image will be wider than the block box. So overflow occurs.

Steve
Thanks for the clarification, Steve. To carry on from this, lets say a
page consists of 2 floats, a left and a right, of equal width. Now
assume that an image in the left float overflows in to the right float.
What's the correct behaviour? In FF and Opera the right float stays
where it is and the left float's image "overflows" on to it, in IE the
right float is pushed under the left float. I'm assuming the behaviour
seen in FF and Opera is correct.......is that so? Is there anywhere in
the spec that you know of that deals with this situation? Had a look
through but couldn't spot anything.

Ta,

Jim.

Aug 2 '06 #3
Jim wrote:
Steve Pugh wrote:
Jim wrote:
Should the browser increase the div to 205px? or overflow the image?
Reading the spec http://www.w3.org/TR/CSS21/visufx.html it makes no
reference to inline-replaced elements though I'd assume that it behaves
in the same way as a block-level box.
As inline-replaced elements are still inline elements they exists
inside line boxes, therefore the first bullet point seems to apply.

"A line cannot be broken, causing the line box to be wider than the
block box."

As you can't break a line inside an image, the line box containing the
image will be wider than the block box. So overflow occurs.

Thanks for the clarification, Steve. To carry on from this, lets say a
page consists of 2 floats, a left and a right, of equal width. Now
assume that an image in the left float overflows in to the right float.
What's the correct behaviour? In FF and Opera the right float stays
where it is and the left float's image "overflows" on to it, in IE the
right float is pushed under the left float. I'm assuming the behaviour
seen in FF and Opera is correct.......is that so? Is there anywhere in
the spec that you know of that deals with this situation? Had a look
through but couldn't spot anything.
No need for specific rules, the standard rules for floats and for
overflows cover this.

Assuming that the floats have widths set and that the images are
contained within floated elements and are not floated themselves...

Then yes, FF and Opera are correct and IE is wrong. The floated
elements are placed first according to the rules for floats. If the
floats were too wide to fit alongside each other then the one defined
last would drop down. But if they fit, they fit.

The too wide image doesn't make the floated element any wider, so it
can't cause the placement of the floats to be recalculated. It does
overflow as per normal.

IE gets the overflow wrong and extends the floated container, this then
causes the calculations for float placement to be re-evaluated and the
last specified float is moved downwards.

Steve

Aug 2 '06 #4

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

Similar topics

12
by: Major Man | last post by:
Hi, I have this .jpg picture that's 700 x 200. What I wanna do is display it on a 300 x 200 window, and have it scroll left and right, back and forth. Can anyone help this newbie? TIA
6
by: Dan V. | last post by:
What is the best/simplest way to have a large top image with let's say 14 thumbnails under it in 7 rows and to replace the top image with the larger one when a user clicks on a thumbnail? I would...
4
by: Troy | last post by:
Hi all, Im a little new to ASP.NET. I'm looking to create an image viewer that zooms in, pretty common. But I need to draw a box on the 1:1 scale image and 'zoom in' on another picture box. ...
6
by: jesper_lofgren | last post by:
Hi, I wonder if its possible to show and hide a image with javascipt. I want the image to disapear from bottom and up very smooth, maybe under 3-4sec. Is it possible ? any tips ? Thanks
4
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all I have the following code: I am trying to use the value of the image button to evaluate what plan the user has chosen, i.e. it request("submit1")="Basic", then the user chose basic plan...
3
by: Sven C. Koehler | last post by:
Hello, the html below displays a box (#container) with a #footer and an #image inside. Is there any way how I could get rid of declaring max-width and max-height for the #image? The #image...
1
by: rsteph | last post by:
I've got some product information pages, with images and text, all setup within a table. I'm trying to add a small image in the upper right hand corner of the content div (where all the important...
1
by: swc76801 | last post by:
I desperately need help. My understanding of CSS is non-existent. I have a store http://astore.amazon.com/texasheat-20 with Amazon.com. According to the information from Amazon.com "Write your own...
16
by: stevedude | last post by:
CSS newbie again. I have a problem trying to get coffee mug images within anchor tags to center with my link text for a vertical list menu. If I use the horizontal/vertical properties of...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.