:: Forum >>

DOCTYPE problem

If I put this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//RU" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

then grid's layout in FireFox seem to be broken. For example if I say that grid must be 100% width, id does, but 6px goes to right of the visible area. If I do not put DOCTYPE then everything woks like it must.
Denis Ignatenko
Thursday, March 22, 2007
This is actually the correct behavior according to W3C 'specs' - in standards-compliant mode the CSS width attribute refers to the inner content width, i.e. total width minus border and padding. So when you set the object width to 100% it means that the object content width will be 100% of the parent element width and the remaining padding and border will be outside of the parent or overlapping with the parent padding/border.

When the page does not contain DOCTYPE declaration the browser goes into 'quirks' (or backward-compatible) mode with much more intuitive box model - the CSS width refers to the 'outer' or border width.

All AW controls have the same 8px horizontal, 4px vertical border+padding width/height in standards-compliant mode. You should take this into account when using CSS width/height attributes. The setSize() method does this automatically.

If you absolutely have to use standards-compliant DOCTYPE for compatibility or some other reasons - try using display:block;width:auto or absolute positioning or add padding to the parent element.
Alex (ActiveWidgets)
Friday, March 23, 2007

This topic is archived.


Back to support forum

Forum search