473,587 Members | 2,316 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IE7 max-width oddity -- any known solution?

After finding a page on an existing site that was not being displayed
correctly by IE7, I have boiled the problem down to the following
simple example:

http://bsb.me.uk/tmp/bug.html

With max-width applied to the paragraphs, the second one is positioned
as if it had "clear: right" applied (but of course it does not).
Other tested browsers behave as I'd expect.

This looks to me like an IE7 bug. Is it know? Is there a known
solution (other than avoiding max-width)?

--
Ben.
Mar 30 '07 #1
8 16322
Ben Bacarisse wrote:
>
http://bsb.me.uk/tmp/bug.html

This looks to me like an IE7 bug.
IE7's max-width handling is less than perfect. If you want to see
something even more strange, try max-width on list items. The list
markers end up in an odd place.
Is there a known solution (other than avoiding max-width)?
You could set max-width on the container that holds the paragraphs
instead, but that won't work in all cases. Depends on the design.

--
Berg
Mar 30 '07 #2
Els
Bergamot wrote:
Ben Bacarisse wrote:
>>
http://bsb.me.uk/tmp/bug.html

This looks to me like an IE7 bug.

IE7's max-width handling is less than perfect. If you want to see
something even more strange, try max-width on list items. The list
markers end up in an odd place.
I tried that out, but all that happens is they disappear, same as when
you set a width on them.
>Is there a known solution (other than avoiding max-width)?

You could set max-width on the container that holds the paragraphs
instead, but that won't work in all cases. Depends on the design.
Or you could just take the picture out of the first paragraph, and
place it before it.
What is happening in the above example, is that the first paragraph
gets extended to encompass the float inside, because of the set
min-width. Basically IE7 does the same as if you'd given a width
instead of a max-width. In IE (not just 7), a width or height gives an
element "layout".
http://www.satzansatz.de/cssd/onhavinglayout.html
--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Mar 30 '07 #3
Els wrote:
Bergamot wrote:
>>
IE7's max-width handling is less than perfect. If you want to see
something even more strange, try max-width on list items. The list
markers end up in an odd place.

I tried that out, but all that happens is they disappear
Not always. It may also depend on left margin or padding, or whether
max-width is set on the ul or li element. I've seen cases where the
markers disappear altogether, but also where the marker ends up aligned
with the last line in the list item.

this is a list item that
wraps to multiple lines
and the marker is on the
* last line

--
Berg
Mar 30 '07 #4
Bergamot <be******@visi. comwrites:
Ben Bacarisse wrote:
> http://bsb.me.uk/tmp/bug.html
<snip>
>Is there a known solution (other than avoiding max-width)?

You could set max-width on the container that holds the paragraphs
instead, but that won't work in all cases. Depends on the design.
Thanks. That certainly stops the "peculiar" behaviour. I'll see if I
can do that in the real site.

--
Ben.
Mar 31 '07 #5
Els <el*********@ti scali.nlwrites:
Bergamot wrote:
>Ben Bacarisse wrote:
>>>
http://bsb.me.uk/tmp/bug.html
<snip>
>>Is there a known solution (other than avoiding max-width)?

You could set max-width on the container that holds the paragraphs
instead, but that won't work in all cases. Depends on the design.

Or you could just take the picture out of the first paragraph, and
place it before it.
Yes but that, of course, does not position that image in the same
place, and requires extra markup to make a valid page.
What is happening in the above example, is that the first paragraph
gets extended to encompass the float inside, because of the set
min-width. Basically IE7 does the same as if you'd given a width
instead of a max-width. In IE (not just 7), a width or height gives an
element "layout".
http://www.satzansatz.de/cssd/onhavinglayout.html
Ah. I am still confused but I can see the fog much more clearly!
Elements with "layout" auto clear in IE, it seems. Sadly, most people
seem to need hacks to give an element layout rather than prevent one
from gaining it.

--
Ben.
Mar 31 '07 #6
Els
Ben Bacarisse wrote:
Els <el*********@ti scali.nlwrites:
>Bergamot wrote:
>>Ben Bacarisse wrote:

http://bsb.me.uk/tmp/bug.html
<snip>
>>>Is there a known solution (other than avoiding max-width)?

You could set max-width on the container that holds the paragraphs
instead, but that won't work in all cases. Depends on the design.

Or you could just take the picture out of the first paragraph, and
place it before it.

Yes but that, of course, does not position that image in the same
place, and requires extra markup to make a valid page.
*one* extra div - I personally wouldn't worry about that.
>What is happening in the above example, is that the first paragraph
gets extended to encompass the float inside, because of the set
min-width. Basically IE7 does the same as if you'd given a width
instead of a max-width. In IE (not just 7), a width or height gives an
element "layout".
http://www.satzansatz.de/cssd/onhavinglayout.html

Ah. I am still confused but I can see the fog much more clearly!
Elements with "layout" auto clear in IE, it seems.
I suppose you could call it that (auto clear), but it is more than
that - layout makes the element rectangular with 'closed borders' -
keeping floats inside instead of sticking out.
Sadly, most people
seem to need hacks to give an element layout rather than prevent one
from gaining it.
Yup. BTW, to get what I think you want, you would need to also use
that one extra div to set the max-width on (as Berg suggested), as the
paragraphs would still have layout if you set the max-width on them,
meaning that if a paragraph is taller than the floated image, it will
not wrap below the image, but remain one rectangular block, with the
image beside it.
Only the next paragraph would go wider, below the image.

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Mar 31 '07 #7
Els <el*********@ti scali.nlwrites:
Ben Bacarisse wrote:
>Els <el*********@ti scali.nlwrites:
>>Bergamot wrote:

Ben Bacarisse wrote:
>
http://bsb.me.uk/tmp/bug.html
<snip>
>>>>Is there a known solution (other than avoiding max-width)?

You could set max-width on the container that holds the paragraphs
instead, but that won't work in all cases. Depends on the design.

Or you could just take the picture out of the first paragraph, and
place it before it.

Yes but that, of course, does not position that image in the same
place, and requires extra markup to make a valid page.

*one* extra div - I personally wouldn't worry about that.
No, neither would I. It is moving the image outside of the <p>'s
margins that might be an issue. I need to check the details in the
real design.
>>What is happening in the above example, is that the first paragraph
gets extended to encompass the float inside, because of the set
min-width. Basically IE7 does the same as if you'd given a width
instead of a max-width. In IE (not just 7), a width or height gives an
element "layout".
http://www.satzansatz.de/cssd/onhavinglayout.html

Ah. I am still confused but I can see the fog much more clearly!
Elements with "layout" auto clear in IE, it seems.

I suppose you could call it that (auto clear), but it is more than
that - layout makes the element rectangular with 'closed borders' -
keeping floats inside instead of sticking out.
I was just borrowing the term from the URL your posted. Does this
"non-intersecting rectangles behaviour" have an agreed name?
>Sadly, most people
seem to need hacks to give an element layout rather than prevent one
from gaining it.

Yup. BTW, to get what I think you want, you would need to also use
that one extra div to set the max-width on (as Berg suggested),
Yes indeed. And the real-world layout from which this is drawn already
has the extra div so it is just a case of seeing which one of (a)
moving the max-width or (b) moving the <img>s is simpler and/or less
disruptive to the overall layout.

--
Ben.
Mar 31 '07 #8
Els
Ben Bacarisse wrote:

[max-width triggers hasLayout in IE7]
>>>http://www.satzansatz.de/cssd/onhavinglayout.html

Ah. I am still confused but I can see the fog much more clearly!
Elements with "layout" auto clear in IE, it seems.

I suppose you could call it that (auto clear), but it is more than
that - layout makes the element rectangular with 'closed borders' -
keeping floats inside instead of sticking out.

I was just borrowing the term from the URL your posted.
Ah, missed that :-)
Does this "non-intersecting rectangles behaviour" have an agreed name?
Other than 'hasLayout' (which doesn't mean much to many people), I
don't know really. But we could of course agree on "non-intersecting
rectangles behaviour" if no one can come up with a shorter term :-)
And the real-world layout from which this is drawn already
has the extra div so it is just a case of seeing which one of (a)
moving the max-width or (b) moving the <img>s is simpler and/or less
disruptive to the overall layout.
Yup - each design needs its own solutions to common problems.

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/
Mar 31 '07 #9

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

Similar topics

1
5626
by: Steven Bethard | last post by:
So I've been playing around with trying to add a keyword argument to min and max that works similarly to the one for sorted. It wasn't too hard actually, but it does raise a few questions about proper handling of keyword arguments. Currently, help(max) gives: max(...) max(sequence) -> value max(a, b, c, ...) -> value With a single...
2
2319
by: Jack | last post by:
Greetings folks, Just curious if anyone knows what the following would produce: SELECT MAX( ECP_SUPPORT_DED_EMAIL.CD_TYP_CMPGN) CD_TYP_CMPGN, MAX(ECP_SUPPORT_DED_EMAIL.CELL_ID) CELL_ID, ECP_SUPPORT_DED_EMAIL.CLIC_CUST_ID CUSTID, MAX( ECP_SUPPORT_DED_EMAIL.ADDRESS) CONTACTED_PARTYID, MAX( ECP_SUPPORT_DED_EMAIL.CONTACTED_PARTY_ID_TYPE...
0
3811
by: Tanamon | last post by:
Hello All, I am a MySQL newbie trying to write a query that selects file_name records possessing the highest numbered version for that unique file_name. I show sample data and two trial queries below. Logically I want to use max(version) as a constraint in a Where Clause. However, the max() function is not allowed directly in a where...
2
6626
by: Pink Panther | last post by:
Using the following SQL can the results be explained? Using A97 (with the SP2 for Jet 3.5) or A2002 CREATE TABLE Test (PK Number CONSTRAINT PK_TEST PRIMARY KEY, ParentID Number, Child Number); INSERT INTO Test VALUES(1,1,1); INSERT INTO Test VALUES(2,1,2);
3
6726
by: Ker | last post by:
I have a query that works great. It gives me the min for multiple fields. Within this query, I also need to get the max of some fields too. I currently have output of Date Name Min Start 9/1/03 Walker Rhines 7:00AM I also need Max such as Max End 3:00PM
61
8611
by: norb1 | last post by:
After tracking down a bug in my Fortran program, I found that it assumed max(NaN,0.) = 0. This makes no sense, as the outcome of the operation is undefined and should be NaN. max(NaN,0.) = NaN After researching, it appears the first outcome is accepted behavior, and might be included in the revised IEEE 754 standard, which affects
38
42889
by: copx | last post by:
Are the macros min() and max() part of stdlib.h or not? (according to the standard?) I have the following problem: I defined my own min() / max() macros because my compiler (MinGW) does NOT define them. When I tried to compile my program with lcc-win32 the compiler complained about macro redefinition, because min() and max() are defined in...
19
29239
by: Eugeny Myunster | last post by:
I know, only simple one: #include <stdio.h> int main() { int min=0,max=0,i,arr; for(i=0;i<12;i++) arr=rand()%31-10; for(i=0;i<12;i++)
54
8323
by: bearophileHUGS | last post by:
Empty Python lists don't know the type of the items it will contain, so this sounds strange: 0 Because that may be an empty sequence of someobject: 0 In a statically typed language in that situation you may answer the
0
1234
by: hong.niu4 | last post by:
please look our website ,have more mode shoes clothing hat cap bags ! Air Max Air Max 87 shoes www.shoestrade.biz Air Max 90 shoes www.shoestrade.biz Air Max 91 shoes www.shoestrade.biz Air Max 93 shoes www.shoestrade.biz Air Max 95 shoes www.shoestrade.biz Air Max 97 shoes www.shoestrade.biz Air Max 2003 shoes www.shoestrade.biz
0
7915
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
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...
0
8339
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...
1
7967
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...
0
6619
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...
0
5392
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...
0
3872
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2347
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
0
1185
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...

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.