There is an essential disparity in current implementations between the horizontal and vertical directions. While the overall document height is automatically extended to accommodate content, the overall document width in automatic computations is implicitly clamped to the initial containing block (i.e. viewport) width. Consider for example this simple document:
<!DOCTYPE html>
<html>
<head>
<title>Horizontal width limit</title>
<style>
html {
width: auto; max-width: none;
border: 1px solid black;
}
body {
width: auto; max-width: none;
border: 1px solid red;
}
div {
width: auto; max-width: none;
display: inline-block;
border: 1px solid blue;
height: 12ex;
max-height: 12ex;
column-width: 60em;
-o-column-width: 60em;
-moz-column-width: 60em;
-webkit-column-width: 60em;
}
</style>
</head>
<body>
<div>
</div>
</body>
</html>
where the actual div
content is omitted, and where the width
and max-width
specifications have been made explicit even though they are the initial values.
The expected result in this example would be to have the div (and consequently the body) expand horizontally to accommodate the content, with columns added as needed. Combined with some max-height binding, this would allow to have a infinite horizontally scrolling canvas not unlike the “standard” vertically scrolling one. However, on all present user agents the above document renders as if the html and body width were clamped by the viewport width. The div columns end up overflowing the limited size, which is shown by the border location. In fact, the unbound horizontal document cannot be achieved currently.
I would like to propose this limitation to be removed, and to treat both the horizontal and vertical directions in essentially the same way. For compatibility with existing documents, this cannot be done arbitrarily, but a possible solution that is backwards compatibility is to specify that documents have a initial value of max-width: 100%
on the document root, and to allow it to be overridden with a max-width: none
to allow automatic horizontal expansion. The implicit initial max-width:100%
specification would be on the :root
pseudo-element, which has higher specificity than the html
and isn’t a fully published standard yet.