473,386 Members | 1,602 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

css 2.1 negative width calculations?

Hi,

I am reading CSS 2.1 draft specification:
http://www.w3.org/TR/2006/WD-CSS21-20061106/

Part of section 10.3.3 (Block-level, non-replaced elements in normal
flow) reads:

If there is exactly one value specified as 'auto', its used value
follows from the equality.

In the case that
margin-left + margin-right width of containing block
(see the constraint in 10.3.3) this would mean that 'width' would be
computed as a negative value in order for the equality to balance.

I'm not sure how a negative width is interpreted. It would seem that
from tests in firefox and opera that they treat used width as 0.

Jan 26 '07 #1
2 3102
On 2007-01-26, da******@hotmail.com <da******@hotmail.comwrote:
Hi,

I am reading CSS 2.1 draft specification:
http://www.w3.org/TR/2006/WD-CSS21-20061106/

Part of section 10.3.3 (Block-level, non-replaced elements in normal
flow) reads:

If there is exactly one value specified as 'auto', its used value
follows from the equality.

In the case that
margin-left + margin-right width of containing block
(see the constraint in 10.3.3) this would mean that 'width' would be
computed as a negative value in order for the equality to balance.
Yes.
I'm not sure how a negative width is interpreted. It would seem that
from tests in firefox and opera that they treat used width as 0.
I'm not sure the spec says anywhere how to interpret a negative width.
You can't actually set a negative value for the width property (that's
"illegal"), although as you say the computed value can be negative.

It makes most sense for it to be rendered as equivalent to 0 (rather
than rendering the box inside-out!)
Jan 26 '07 #2
On 2007-01-26, da******@hotmail.com <da******@hotmail.comwrote:
Hi,

I am reading CSS 2.1 draft specification:
http://www.w3.org/TR/2006/WD-CSS21-20061106/

Part of section 10.3.3 (Block-level, non-replaced elements in normal
flow) reads:

If there is exactly one value specified as 'auto', its used value
follows from the equality.

In the case that
margin-left + margin-right width of containing block
(see the constraint in 10.3.3) this would mean that 'width' would be
computed as a negative value in order for the equality to balance.

I'm not sure how a negative width is interpreted. It would seem that
from tests in firefox and opera that they treat used width as 0.
The other thing is that even if the browser does follow the spec and
compute a negative width, and renders that as a zero width (which seems
the only logical choice), then it has to choose whether to respect the
styled value of margin-left or the styled value of margin-right-- it
can't make both true.

What they mostly seem to do is clamp width to 0 and solve the equality
by taking the difference out of margin-right (and it seems logical it
ought to be margin-left if direction is rtl).

I think it would make more sense if the spec were written that way.
Jan 26 '07 #3

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

Similar topics

179
by: SoloCDM | last post by:
How do I keep my entire web page at a fixed width? ********************************************************************* Signed, SoloCDM
1
by: Wilhelm Kutting | last post by:
Hi i like to make a complex layout with css. All the content is inside a container div. I like to get the following sequence without the css-layout: logo title mainnav content i can only...
9
by: Robert | last post by:
Hi, Maybe this is a simple question, but I can't seem to get it to work. Let's say I have this table: <table style="width: 300px"> <tr> <th>Header</th> <td>1</td> <td>22</td>
7
by: R0bert Nev1lle | last post by:
Internet Explorer always presents me with a challenge (partial repost). The current issue involves emulating max-width in IE using the technique described by Svend Tofte. ...
1
by: Iain West | last post by:
Hi, I have a bit of code which draws a chart up or down from the centre line (zero). When I have negative numbers in MSIE it displays fine and in Mozila it doesn't draw at all. Positve...
11
by: Norman L. DeForest | last post by:
Am I misunderstanding the CSS specifications or is Firefox (version 1.0.6) (and Opera) doing the wrong thing? It appears that Firefox 1.0.6 includes the border in width calculations for tables...
1
by: yb | last post by:
Hello, I've been trying to emulate css min-width and max-width in IE. I've looked at various methods on the web, but none seemed to truly emulate min-width / max-width, or at least not very...
1
by: Shadow Lynx | last post by:
Consider this simple HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 STRICT//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head>...
1
by: comp.lang.php | last post by:
Sorry folks, I'm on a roll!!! I need to calculate the height or width of an image if you change either the width or height and don't change BOTH of them at the same time, this is to "vector" the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.