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

Home Posts Topics Members FAQ

auto width is not computed correctly in explorer strict mode

according to the w3c :
http://www.w3.org/TR/CSS21/visudet.h...replaced-width

The rules for calculating width for absolutely positioned non-replaced
elements say that when 'left' and 'right' are not 'auto' and 'width' is
'auto'.... then..... solve for width

---------------------------------------------------------------------------------------------
'width' is 'auto', 'left' and 'right' are not 'auto', then solve for
'width'
---------------------------------------------------------------------------------------------

using....

---------------------------------------------------------------------------------------------
'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width'
+ 'padding-right' + 'border-right-width' + 'margin-right' + 'right' +
scrollbar width (if any) = width of containing block
---------------------------------------------------------------------------------------------

so if i set 'left' and 'right' both to '0px' (and have no
border,padding,margin,or scrollbar) then the absolutely positioned
element width should be equal to the width of the containing block

this works in firefox of course. it does not work in explorer, even
with strict mode

am i missing something here? i thought strict mode was supposed to
make explorer follow the w3c visual formatting details... this seems to
be a pretty major mistake

Nov 17 '06 #1
5 1888
On 2006-11-17, bordsby <bo*****@gmail.comwrote:
according to the w3c :
http://www.w3.org/TR/CSS21/visudet.h...replaced-width

The rules for calculating width for absolutely positioned non-replaced
elements say that when 'left' and 'right' are not 'auto' and 'width' is
'auto'.... then..... solve for width

---------------------------------------------------------------------------------------------
'width' is 'auto', 'left' and 'right' are not 'auto', then solve for
'width'
---------------------------------------------------------------------------------------------

using....

---------------------------------------------------------------------------------------------
'left' + 'margin-left' + 'border-left-width' + 'padding-left' + 'width'
+ 'padding-right' + 'border-right-width' + 'margin-right' + 'right' +
scrollbar width (if any) = width of containing block
---------------------------------------------------------------------------------------------

so if i set 'left' and 'right' both to '0px' (and have no
border,padding,margin,or scrollbar) then the absolutely positioned
element width should be equal to the width of the containing block
Correct.
this works in firefox of course. it does not work in explorer, even
with strict mode

am i missing something here? i thought strict mode was supposed to
make explorer follow the w3c visual formatting details... this seems to
be a pretty major mistake
No, you're not missing anything (so long as you're sure you're getting
it into strict mode) and yes it is a major mistake, and not one it would
have been difficult for them to fix either.

One wonders if they're doing it on purpose sometimes.
Nov 17 '06 #2
darn, i really wish i would have been missing something. i use this
concept over and over in my pages (setting the left/right so the width
is auto) because it is just like anchoring blocks a fixed distance from
the container edge... makes lots of stuff easier... they have to be
doing that on purpose... or they are just bad programmers for not
understanding the spec...

Nov 17 '06 #3
Once upon a time *bordsby* wrote:
darn, i really wish i would have been missing something. i use this
concept over and over in my pages (setting the left/right so the width
is auto) because it is just like anchoring blocks a fixed distance from
the container edge... makes lots of stuff easier... they have to be
doing that on purpose... or they are just bad programmers for not
understanding the spec...
*How to quote:* http://www.netmeister.org/news/learn2quote.html#toc2
*From Google:* http://www.safalra.com/special/googlegroupsreply/

--
/Arne

Proud User of SeaMonkey. Get your free copy:
http://www.mozilla.org/projects/seamonkey/
Nov 17 '06 #4
bordsby wrote :

[snipped]
it does not work in explorer, even
with strict mode

am i missing something here? i thought strict mode was supposed to
make explorer follow the w3c visual formatting details... this seems to
be a pretty major mistake
Are you referring to IE 6? Or are you referring to IE 7?
Can you post a url where this problem occurs? Because over here, it
works in IE 7.

Gérard
--
remove blah to email me
Nov 18 '06 #5
bordsby wrote :
it does not work in explorer, even
with strict mode

am i missing something here?
"some of the other bugs that we [Microsoft] fixed [in IE 7]:
(...)
Auto-sizing of absolute positioned element with width:auto and right &
left (great for 3 column layouts)"
http://blogs.msdn.com/ie/archive/2006/08/22/712830.aspx

Gérard
--
remove blah to email me
Nov 18 '06 #6

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

Similar topics

8
by: brett | last post by:
How can I find the height and width of a webpage? Say I want to make sure someone's webpage is within an 800X600 viewing area. Width is the most important but if I can get width, I should also be...
8
by: steve | last post by:
Is there any clear indication yet of whether Microsoft are intending to fix their box model in the latest release of Internet Explorer, version 7.0? (For an explanation of what this is, see here...
3
by: stan | last post by:
I have code that produces 5 boxes across the screen width. So far I have only tested it in IE 6 and NS 8. It works in IE, but in NS I am not able to fit in the 5th box. I am using two...
4
by: petermichaux | last post by:
Hi, I'm curious why the follow little HTML page produces "auto" for JavaScript output. I thought that getComputedStyle() was supposed to return integer px values for lengths. Is this a problem...
3
by: jdlwright | last post by:
Hi, I need to place a DIV exactly over a textarea element, but I can't calculate the correct value that I should set style.width to, because offsetWidth and style.width are calculated differently...
4
by: reycri | last post by:
I have a page that works as I intend in IE but not in Firefox: <html> <head> <title>Overflow Test</title> </head> <body style='overflow:hidden; margin:0; padding:0;'> <table border='0'...
11
by: Gérard Talbot | last post by:
Hello, <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <title></title> <style type="text/css"> body {background-color: white; color: black;}...
2
by: TonyV | last post by:
Okay, this is driving me nuts, and while I'm still researching, I'm hoping someone here can help. I'm trying to create a simple page with a navigation menu on the left side of the main content...
1
by: =?Utf-8?B?d2NsYXJrZTEwMQ==?= | last post by:
Hello all, I've created the following ASP.NET code sample which, when rendered, displays a 100% textbox within a single cell table. The problem is that Internet Explorer (6 or 7) truncates the...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
1
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...
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
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.