CR-css3-multicol-20110412 73.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html lang=en>
 <head>
  <title>CSS Multi-column Layout Module</title>
  <link href=default.css rel=stylesheet type="text/css">
  <link href="http://www.w3.org/StyleSheets/TR/W3C-CR.css" rel=stylesheet
  type="text/css">

  <style type="text/css">
.cols { width: 500px; height: 200px; background: #fff; position: relative; border: solid 5px blue; margin: 0.5em 2em 1em 0; font: bold 14px/19px Arial, sans-serif }
.cols p { padding: 3px; margin: 0 }
.col { position: absolute; left: 0px; top: 0; z-index: 6; width: 170px }
.gap { position: absolute; background: green; width: 5px; bottom: 0px; top: 0px; border: 10px solid yellow; border-top-width: 0; border-bottom-width: 0;  }
.rep { position: absolute; top: 45px; background: black; height: 110px; width: 100px;  color: white; z-index: 4 }

table.breaks { border-collapse: collapse; margin: 1em 0 }
table.breaks td, table.breaks th { border: thin solid black; padding: 0.1em 0.2em }

div.example:before { width: 9em }
</style>

 <body>
  <div class=head> <!--begin-logo-->
   <p><a href="http://www.w3.org/"><img alt=W3C height=48
    src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->

   <h1>CSS Multi-column Layout Module</h1>

   <h2 class="no-num no-toc" id=w3c-working>W3C Candidate Recommendation 12
    April 2011</h2>

   <dl>
    <dt>This version:

    <dd> <a
     href="http://www.w3.org/TR/2011/CR-css3-multicol-20110412">http://www.w3.org/TR/2011/CR-css3-multicol-20110412</a>
     <!--<a href="http://dev.w3.org/csswg/css3-multicol/">http://dev.w3.org/csswg/css3-multicol/</a>-->
     

    <dt>Latest version:

    <dd><a href="http://www.w3.org/TR/css3-multicol">
     http://www.w3.org/TR/css3-multicol</a>

    <dt>Previous version:

    <dd><a
     href="http://www.w3.org/TR/2009/CR-css3-multicol-20091217">http://www.w3.org/TR/2009/CR-css3-multicol-20091217</a>
     

    <dt>Editors:

    <dd>H&aring;kon Wium Lie, Opera Software, howcome@opera.com
   </dl>
   <!--begin-copyright-->
   <p class=copyright><a
    href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
    rel=license>Copyright</a> &copy; 2011 <a
    href="http://www.w3.org/"><acronym title="World Wide Web
    Consortium">W3C</acronym></a><sup>&reg;</sup> (<a
    href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute
    of Technology">MIT</acronym></a>, <a href="http://www.ercim.eu/"><acronym
    title="European Research Consortium for Informatics and
    Mathematics">ERCIM</acronym></a>, <a
    href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a
    href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
    <a
    href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
    and <a
    href="http://www.w3.org/Consortium/Legal/copyright-documents">document
    use</a> rules apply.</p>
   <!--end-copyright-->
   <hr title="Separator for header">
  </div>

  <h2 class="no-num no-toc" id=abstract>Abstract</h2>

  <p>This specification describes multi-column layouts in CSS, a style sheet
   language for the web. Using functionality described in the specification,
   content can be flowed into multiple columns with a gap and a rule between
   them.

  <h2 class="no-num no-toc" id=status-of-this-document>Status of this
   document</h2>
  <!--begin-status-->

  <p><em>This section describes the status of this document at the time of
   its publication. Other documents may supersede this document. A list of
   current W3C publications and the latest revision of this technical report
   can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
   index at http://www.w3.org/TR/.</a></em>

  <p>This document was produced by the <a
   href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> as a <a
   href="http://www.w3.org/Consortium/Process/tr#RecsCR">Candidate
   Recommendation.</a>

  <p>A Candidate Recommendation is a document that has been widely reviewed
   and is ready for implementation. W3C encourages everybody to implement
   this specification and return comments to the (<a
   href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
   mailing list <a
   href="mailto:www-style@w3.org?Subject=%5Bcss3-multicol%5D%20PUT%20SUBJECT%20HERE">
   www-style@w3.org</a> (see <a
   href="http://www.w3.org/Mail/Request">instructions</a>). When sending
   e-mail, please put the text &#8220;css3-multicol&#8221; in the subject,
   preferably like this: &#8220;[<!---->css3-multicol<!---->]
   <em>&hellip;summary of comment&hellip;</em>&#8221;

  <p>Publication as a Candidate Recommendation does not imply endorsement by
   the W3C Membership. This is a draft document and may be updated, replaced
   or obsoleted by other documents at any time. It is inappropriate to cite
   this document as other than work in progress.

  <p>This document was produced by a group operating under the <a
   href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
   2004 W3C Patent Policy</a>. W3C maintains a <a
   href="http://www.w3.org/2004/01/pp-impl/32061/status"
   rel=disclosure>public list of any patent disclosures</a> made in
   connection with the deliverables of the group; that page also includes
   instructions for disclosing a patent. An individual who has actual
   knowledge of a patent which the individual believes contains <a
   href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">
   Essential Claim(s)</a> must disclose the information in accordance with <a
   href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">
   section 6 of the W3C Patent Policy</a>.</p>
  <!--end-status-->

  <p>This document has been a Working Draft in the CSS Working Group for
   several years. Multi-column layouts are traditionally used in print. On
   screen, multi-column layouts have been considered experimental, and
   implementation and use experience was deemed necessary in order to
   proceed. Several implementations have occurred over the past years, and
   this specification incorporates useful feedback from implementors as well
   as authors and users.

  <p>The specification was updated in April 2011 to correct a contradiction
   between the text and the pseudo-algorithm in section&nbsp;3.4. The
   pseudo-algorithm was corrected and also made easier to read. The wording
   of a few other sections was improved in places, without changes to the
   functionality.

  <p>This document will remain Candidate Recommendation at least until 12 May
   2011. See the <a href="#cr-exit-criteria">CR exit criteria.</a>

  <h2 class="no-num no-toc" id=table-of-contents><a name=contents>Table of
   contents</a></h2>
  <!--begin-toc-->

  <ul class=toc>
   <li><a href="#introduction"><span class=secno>1. </span>Introduction</a>

   <li><a href="#the-multi-column-model"><span class=secno>2. </span>The
    multi-column model</a>

   <li><a href="#the-number-and-width-of-columns"><span class=secno>3.
    </span>The number and width of columns</a>
    <ul class=toc>
     <li><a href="#cw"><span class=secno>3.1. </span>&lsquo;<code
      class=property>column-width</code>&rsquo;</a>

     <li><a href="#cc"><span class=secno>3.2. </span>&lsquo;<code
      class=property>column-count</code>&rsquo;</a>

     <li><a href="#columns"><span class=secno>3.3. </span>&lsquo;<code
      class=property>columns</code>&rsquo;</a>

     <li><a href="#pseudo-algorithm"><span class=secno>3.4.
      </span>Pseudo-algorithm</a>

     <li><a href="#stacking-context"><span class=secno>3.5. </span>Stacking
      context</a>
    </ul>

   <li><a href="#column-gaps-and-rules"><span class=secno>4. </span>Column
    gaps and rules</a>
    <ul class=toc>
     <li><a href="#column-gap"><span class=secno>4.1. </span>&lsquo;<code
      class=property>column-gap</code>&rsquo;</a>

     <li><a href="#crc"><span class=secno>4.2. </span>&lsquo;<code
      class=property>column-rule-color</code>&rsquo;</a>

     <li><a href="#crs"><span class=secno>4.3. </span>&lsquo;<code
      class=property>column-rule-style</code>&rsquo;</a>

     <li><a href="#crw"><span class=secno>4.4. </span>&lsquo;<code
      class=property>column-rule-width</code>&rsquo;</a>

     <li><a href="#column-rule"><span class=secno>4.5. </span>&lsquo;<code
      class=property>column-rule</code>&rsquo;</a>
    </ul>

   <li><a href="#column-breaks"><span class=secno>5. </span>Column breaks</a>
    
    <ul class=toc>
     <li><a href="#break-before-break-after-break-inside"><span
      class=secno>5.1. </span>&lsquo;<code
      class=property>break-before</code>&rsquo;, &lsquo;<code
      class=property>break-after</code>&rsquo;, &lsquo;<code
      class=property>break-inside</code>&rsquo;</a>
    </ul>

   <li><a href="#spanning-columns"><span class=secno>6. </span>Spanning
    columns</a>
    <ul class=toc>
     <li><a href="#column-span"><span class=secno>6.1. </span>&lsquo;<code
      class=property>column-span</code>&rsquo;</a>
    </ul>

   <li><a href="#filling-columns"><span class=secno>7. </span>Filling
    columns</a>
    <ul class=toc>
     <li><a href="#cf"><span class=secno>7.1. </span>&lsquo;<code
      class=property>column-fill</code>&rsquo;</a>
    </ul>

   <li><a href="#overflow"><span class=secno>8. </span>Overflow</a>
    <ul class=toc>
     <li><a href="#overflow-inside-multicol-elements"><span class=secno>8.1.
      </span>Overflow inside multicol elements</a>

     <li><a href="#pagination-and-overflow-outside-multicol"><span
      class=secno>8.2. </span>Pagination and overflow outside multicol
      elements</a>
    </ul>

   <li><a href="#conformance"><span class=secno>9. </span>Conformance</a>
    <ul class=toc>
     <li><a href="#cr-exit-criteria"><span class=secno>9.1. </span>CR exit
      criteria</a>
    </ul>

   <li class=no-num><a href="#acknowledgments">Acknowledgments</a>

   <li class=no-num><a href="#references">References</a>
    <ul class=toc>
     <li class=no-num><a href="#normative-references">Normative
      references</a>

     <li class=no-num><a href="#other-references">Other references</a>
    </ul>

   <li class=no-num><a href="#index">Index</a>

   <li class=no-num><a href="#property-index">Property index</a>
  </ul>
  <!--end-toc-->

  <h2 id=introduction><span class=secno>1. </span>Introduction</h2>

  <p>(This section is not normative.)

  <p>This module describes multi-column layout in CSS. By using functionality
   described in this document, style sheets can declare that the content of
   an element is to be laid out in multiple columns.

  <p>On the Web, tables have also been used to describe multi-column layouts.
   The main benefit of using CSS-based columns is flexibility; content can
   flow from one column to another, and the number of columns can vary
   depending on the size of the viewport. Removing presentation table markup
   from documents allows them to more easily be presented on various output
   devices including speech synthesizers and small mobile devices.

  <p>Multi-column layouts are easy to describe in CSS. Here is a simple
   example:

  <div class=example>
   <pre>body { column-width: 12em }</pre>

   <p>In this example, the <code class=html>body</code> element is set to
    have columns at least &lsquo;<code class=css>12em</code>&rsquo; wide. The
    exact number of columns will depend on the available space.
  </div>

  <p>The number of columns can also be set explicitly in the style sheet:

  <div class=example>
   <pre>body { column-count: 2 }</pre>

   <p>In this case, the number of columns is fixed and the column widths will
    vary depending on the available width.
  </div>

  <p>The shorthand &lsquo;<a href="#columns0"><code
   class=property>columns</code></a>&rsquo; property can be used to set
   either, or both, properties in one declaration.

  <div class=example>
   <p>In these examples, the number of columns, the width of columns, and
    both the number and width are set, respectively:

   <pre>
body { columns: 2 }
body { columns: 12em }
body { columns: 2 12em }
</pre>

   <p>However, as described below, setting both the width and number of
    columns rarely makes sense.
  </div>

  <p>Another group of properties introduced in this module describe gaps and
   rules between columns.

  <div class=example>
   <pre>
body { 
  column-gap: 1em;
  column-rule: thin solid black;
}
</pre>

   <p>The first declaration in the example above sets the gap between two
    adjacent columns to be 1em. Column gaps are similar to padding areas. In
    the middle of the gap there will be a rule which is described by the
    &lsquo;<a href="#column-rule0"><code
    class=property>column-rule</code></a>&rsquo; property.
  </div>

  <p>The values of the &lsquo;<a href="#column-rule0"><code
   class=property>column-rule</code></a>&rsquo; property are similar to those
   of the CSS border properties. Like &lsquo;<code
   class=property>border</code>&rsquo;, &lsquo;<a href="#column-rule0"><code
   class=property>column-rule</code></a>&rsquo; is a shorthand property.

  <div class=example>
   <p>In this example, the shorthand &lsquo;<a href="#column-rule0"><code
    class=property>column-rule</code></a>&rsquo; declaration from the above
    example has been expanded:

   <pre>
body { 
  column-gap: 1em;
  column-rule-width: thin;
  column-rule-style: solid;
  column-rule-color: black;
}
</pre>
  </div>

  <p>The &lsquo;<a href="#column-fill"><code
   class=property>column-fill</code></a>&rsquo; and &lsquo;<a
   href="#column-span0"><code class=property>column-span</code></a>&rsquo;
   properties give style sheets a wider range of visual expressions in
   multi-column layouts.

  <div class=example>
   <p>In this example, columns are set to be balanced, i.e., to have
    approximately the same length. Also, <code>h2</code> elements are set to
    span across all columns.

   <pre>
div { column-fill: balance }
h2 { column-span: all }
</pre>
  </div>

  <p>This specification introduces ten new properties, all of which are used
   in the examples above.

  <p>To indicate where column breaks should (or should not) appear, new
   keyword values are introduced.

  <div class=example>
   <p>In this example, <code>h1</code> elements will always have a column
    break before them, but the formatter will try to avoid column breaks
    inside and after the element.

   <pre>
h1 { 
  break-before: column; 
  break-inside: avoid-column; 
  break-after: avoid-column;
}
</pre>
   <!--<p>The properties and values used in this example are formally defined in [!CSS3PAGE]].-->
   </div>

  <p>If all column properties have their initial value, the layout of an
   element will be identical to a multi-column layout with only one column.

  <h2 id=the-multi-column-model><span class=secno>2. </span>The multi-column
   model</h2>

  <p>A <dfn id=multi-column-element>multi-column element</dfn> (or
   <em>multicol element</em> for short) is an element whose &lsquo;<a
   href="#column-width"><code class=property>column-width</code></a>&rsquo;
   or &lsquo;<a href="#column-count"><code
   class=property>column-count</code></a>&rsquo; property is not &lsquo;<code
   class=css>auto</code>&rsquo; and therefore acts as a container for
   multi-column layout.

  <p>In the traditional CSS box model, the content of an element is flowed
   into the content box of the corresponding element. Multi-column layout
   introduces a new type of container between the content box and the
   content, namely the <dfn id=column-box>column box</dfn> (or
   <em>column</em> for short). The content of a multicol element is flowed
   into its column boxes.

  <p>Column boxes in a multi-column element are arranged into <em>rows</em>.
   Like table cells, the column boxes in a row are ordered in the inline
   direction of the multicol element. The <em>column width</em> is the length
   of the column box in the inline direction. The <em>column height</em> is
   the length of the column box in the block direction. All column boxes in a
   row have the same column width, and all column boxes in a row have the
   same column height. Within each row in the multi-column element, adjacent
   column boxes are separated by a <em>column gap</em>, which may contain a
   <em>column rule</em>. All column gaps in the same row are equal. All
   column rules in the same row are also equal, if they appear; column rules
   only appear between columns that both have content.

  <p>In the simplest case a multicol element will contain only one row of
   columns, and the height of each column will be equivalent to the used
   height of the multi-column element's content box. If the multi-column
   element is paginated, the height of each row is constrained by the page
   and the content continues in a new row of column boxes on the next page; a
   column box never splits across pages. The same effect occurs when a <a
   href="#spanning-element"><em>spanning element</em></a> divides the
   multi-column element: the columns before the spanning element are balanced
   and shortened to fit their content. Content after the spanning element
   then flows into a new row of column boxes.

  <p>It is not possible to set properties/values on column boxes. For
   example, the background of a certain column box cannot be set and a column
   box has no concept of padding, margin or borders.

  <p class=note>Future specifications may add additional functionality. For
   example, columns of different widths and different backgrounds may be
   supported.

  <div class=example>
   <p>Column gaps (yellow) and column rules (green) are shown in this sample
    rendition of a multi-column element with padding (blue). The blue and
    yellow is present for illustrational purposes only. In actual
    implementations these areas will be determined by the background.

   <div class=cols>
    <div class=col style="">
     <p> Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs<br>
      tuv wxy z. Abc de fg<br>
      hi jklmno. Pqrstu vw<br>
      x yz. Abc def ghi jkl.<br>
      M nop qrst uv wx yz.<br>
      Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs
    </div>

    <div class=col style="left: 175px">
     <p> tuv wxy z. Abc de fg<br>
      hi jklmno. Pqrstu vw<br>
      x yz. Abc def ghi jkl.<br>
      M nop qrst uv wx yz.<br>
      Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs<br>
      tuv wxy z. Abc de fg<br>
      hi jklmno. Pqrstu vw<br>
      x yz. Abc def ghi jkl.<br>
    </div>

    <div class=col style="left: 350px">
     <p> M nop qrst uv wx yz.<br>
      Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs<br>
      tuv wxy z. Abc de fg<br>
      hi jklmno. Pqrstu vw<br>
      x yz. Abc def ghi jkl.<br>
      M nop qrst uv wx yz.<br>
      Ab cde fgh i jkl. Mno<br>
      Pqr stu vw xyz.
    </div>

    <div class=gap style="left: 150px"></div>

    <div class=gap style="left: 325px"></div>
   </div>

   <p>To illustrate the effects of the various properties described in this
    specification, variations on a sample document will be used. Here is the
    source code of the sample document:

   <pre class=html>
&lt;html>
&lt;style type="text/css">
div {
  column-width: 15em;
  column-gap: 2em;   /* shown in yellow */            
  column-rule: 4px solid green;
  padding: 5px;      /* shown in blue */
}
p { margin: 0; padding: 0 }
img { display: none }
&lt;/style>
&lt;body>
&lt;div>
&lt;p&gt;Ab cde fgh i jkl. Mno 
pqr stu vw xyz. A bc
&lt;img src=...>
def g hij
...
&lt;/div>
&lt;/body>
&lt;/html>
</pre>

   <p>The nonsensical text in the example is the English alphabet which shows
    how text flows from one column to another. To simplify the visualization,
    the textual content of the different examples vary slightly.
  </div>

  <p>Column boxes act as the containing block for their content. That is,
   column boxes behave like block-level, table cell, and inline-block boxes
   as per CSS 2.1, section 10.1, item 2 <a href="#CSS21"
   rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>. However, column boxes do not
   establish containing blocks for elements with &lsquo;<code
   class=css>position: fixed</code>&rsquo; or &lsquo;<code
   class=css>position: absolute</code>&rsquo;.
   <!--Percentage values that are calculated
relative to the containing block height are calculated based on the
multicol element's height, not the column box's height.-->
   

  <div class=example>
   <p>In this example, the width of the image is set with these rules:

   <pre class=css>
img { display: block; width: 100% }
</pre>

   <p>Given that the width is calculated relative to the column box, the
    image will be as wide as the column box:

   <div class=cols>
    <p>Ab cde fgh i jkl. Mno<br>
     pqr stu vw xyz. A bc<br>
     <br>
     <br>
     <br>
     <br>
     <br>
     <br>
     def g hij klm nopqrs<br>
     tuv wxy z. Abc de fg<br>

    <div class=col style="left: 175px">
     <p>hi jklmno. Pqrstu vw<br>
      x yz. Abc def ghi jkl.<br>
      M nop qrst uv wx yz.<br>
      Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs<br>
      tuv wxy z. Abc de fg<br>
      hi jklmno. Pqrstu vw<br>
      x yz. Abc def ghi jkl.<br>
      M nop qrst uv wx yz.<br>
    </div>

    <div class=col style="left: 350px">
     <p> Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs<br>
      tuv wxy z. Abc de fg<br>
      hi jklmno. Pqrstu vw<br>
      x yz. Abc def ghi jkl.<br>
      M nop qrst uv wx yz.<br>
      Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz.
    </div>

    <div class=rep style="width: 150px"></div>

    <div class=gap style="left: 150px"></div>

    <div class=gap style="left: 325px"></div>
   </div>
  </div>

  <p>Floats that appear inside multi-column layouts are positioned with
   regard to the column box where the float appears.

  <div class=example>
   <p>In this example, this CSS fragment describes the presentation of the
    image:

   <pre class=css>
img { display: block; float: right }
</pre>

   <div class=cols>
    <div class=col style="">
     <p> Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g<br>
      hij klm<br>
      nopq<br>
      rs tuv<br>
      wxy x<br>
      yz. Ab <br>
      cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc
    </div>

    <div class=col style="left: 175px">
     <p> def g hij klm nopqrs<br>
      tuv wxy z. Abc de fg<br>
      hi jklmno. Pqrstu vw<br>
      x yz. Abc def ghi jkl.<br>
      M nop qrst uv wx yz.<br>
      Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs<br>
      tuv wxy z. Abc de fg<br>
      hi jklmno. Pqrstu vw<br>
    </div>

    <div class=col style="left: 350px">
     <p> x yz. Abc def ghi jkl.<br>
      M nop qrst uv wx yz.<br>
      Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs<br>
      tuv wxy z. Abc de fg<br>
      hi jklmno. Pqrstu vw<br>
      x yz. Abc def ghi jkl.<br>
      M nop qrst uv wx yz.<br>
    </div>

    <div class=rep style="left: 50px"></div>

    <div class=gap style="left: 150px"></div>

    <div class=gap style="left: 325px"></div>
   </div>

   <p>The black box represents the image.
  </div>

  <p>A multi-column element establishes a new block formatting context, as
   per CSS 2.1 section 9.4.1.

  <div class=example>
   <p>A top margin set on the first child element of a multicol element will
    not collapse with the margins of the multicol element.
  </div>

  <p>Nested multi-column elements are allowed, but there may be
   implementation-specific limits.

  <h2 id=the-number-and-width-of-columns><span class=secno>3. </span>The
   number and width of columns</h2>

  <p>Finding the number and width of columns is fundamental when laying out
   multi-column content. When the block direction is unconstrained and no
   column breaks are added through style sheets, these two properties
   determine the outcome:

  <ul>
   <li>&lsquo;<a href="#column-count"><code
    class=property>column-count</code></a>&rsquo;

   <li>&lsquo;<a href="#column-width"><code
    class=property>column-width</code></a>&rsquo;
  </ul>

  <p>A third property, &lsquo;<a href="#columns0"><code
   class=property>columns</code></a>&rsquo;, is a shorthand property which
   sets both &lsquo;<a href="#column-width"><code
   class=property>column-width</code></a>&rsquo; and &lsquo;<a
   href="#column-count"><code class=property>column-count</code></a>&rsquo;.

  <h3 id=cw><span class=secno>3.1. </span>&lsquo;<a
   href="#column-width"><code class=property>column-width</code></a>&rsquo;</h3>

  <table class=propdef>
   <tbody>
    <tr>
     <td><em>Name:</em>

     <td><dfn id=column-width>column-width</dfn>

    <tr>
     <td><em>Value:</em>

     <td>&lt;length&gt; | auto

    <tr>
     <td><em>Initial:</em>

     <td>auto

    <tr>
     <td><em>Applies to:</em>

     <td>non-replaced block-level elements (except table elements), table
      cells, and inline-block elements

    <tr>
     <td><em>Inherited:</em>

     <td>no

    <tr>
     <td><em>Percentages:</em>

     <td>N/A

    <tr>
     <td><em>Media:</em>

     <td>visual

    <tr>
     <td><em>Computed&nbsp;value:</em>

     <td>the absolute length, zero or larger
  </table>

  <p>This property describes the width of columns in multicol elements.

  <dl>
   <dt>auto

   <dd>means that the column width will be determined by other properties
    (e.g., &lsquo;<a href="#column-count"><code
    class=property>column-count</code></a>&rsquo;, if it has a non-auto
    value).

   <dt>&lt;length>

   <dd>describes the optimal column width. The actual column width may be
    wider (to fill the available space), or narrower (only if the available
    space is smaller than the specified column width). Specified values must
    be greater than 0.
  </dl>

  <div class=example>
   <p>For example, consider this style sheet:</p>

   <pre>
div {
  width: 100px;
  column-width: 45px;
  column-gap: 0;
  column-rule: none;
}
</pre>

   <p>There is room for two 45px wide columns inside the 100px wide element.
    In order to fill the available space the actual column width will be
    increased to 50px.</p>
  </div>

  <div class=example>
   <p>Also, consider this style sheet:</p>

   <pre>
div {
  width: 40px;
  column-width: 45px;
  column-gap: 0;
  column-rule: none;
}
</pre>

   <p>The available space is smaller than the specified column width and the
    actual column width will therefore be decreased.</p>
  </div>

  <p>To ensure that &lsquo;<a href="#column-width"><code
   class=property>column-width</code></a>&rsquo; can be used with vertical
   text, column width means the length of the line boxes inside the columns.

  <p class=note>The reason for making &lsquo;<a href="#column-width"><code
   class=property>column-width</code></a>&rsquo; somewhat flexible is to
   achieve scalable designs that can fit many screen sizes. To set an exact
   column width, all length values (in horizontal text these are:
   &lsquo;<code class=property>width</code>&rsquo;, &lsquo;<a
   href="#column-width"><code class=property>column-width</code></a>&rsquo;,
   &lsquo;<a href="#column-gap0"><code
   class=property>column-gap</code></a>&rsquo;, and &lsquo;<a
   href="#column-rule-width"><code
   class=property>column-rule-width</code></a>&rsquo;) must be specified.

  <h3 id=cc><span class=secno>3.2. </span>&lsquo;<a
   href="#column-count"><code class=property>column-count</code></a>&rsquo;</h3>

  <table class=propdef>
   <tbody>
    <tr>
     <td><em>Name:</em>

     <td><dfn id=column-count>column-count</dfn>

    <tr>
     <td><em>Value:</em>

     <td>&lt;integer&gt; | auto

    <tr>
     <td><em>Initial:</em>

     <td>auto

    <tr>
     <td><em>Applies to:</em>

     <td>non-replaced block-level elements (except table elements), table
      cells, and inline-block elements

    <tr>
     <td><em>Inherited:</em>

     <td>no

    <tr>
     <td><em>Percentages:</em>

     <td>N/A

    <tr>
     <td><em>Media:</em>

     <td>visual

    <tr>
     <td><em>Computed&nbsp;value:</em>

     <td>specified value
  </table>

  <p>This property describes the number of columns of a multicol element.

  <dl>
   <dt>auto

   <dd>means that the number of columns will be determined by other
    properties (e.g., &lsquo;<a href="#column-width"><code
    class=property>column-width</code></a>&rsquo;, if it has a non-auto
    value).

   <dt>&lt;integer>

   <dd>describes the optimal number of columns into which the content of the
    element will be flowed. Values must be greater than 0. If both &lsquo;<a
    href="#column-width"><code class=property>column-width</code></a>&rsquo;
    and &lsquo;<a href="#column-count"><code
    class=property>column-count</code></a>&rsquo; have non-auto values, the
    integer value describes the maximum number of columns.
  </dl>

  <div class=example>
   <p>Example:</p>

   <pre>body { column-count: 3 }</pre>
  </div>

  <h3 id=columns><span class=secno>3.3. </span>&lsquo;<a
   href="#columns0"><code class=property>columns</code></a>&rsquo;</h3>

  <table class=propdef>
   <tbody>
    <tr>
     <td><em>Name:</em>

     <td><dfn id=columns0>columns</dfn>

    <tr>
     <td><em>Value:</em>

     <td><a href="#cw">&lt;&lsquo;<code
      class=property>column-width</code>&rsquo;></a> || <a
      href="#cc">&lt;&lsquo;<code
      class=property>column-count</code>&rsquo;></a>

    <tr>
     <td><em>Initial:</em>

     <td>see individual properties

    <tr>
     <td><em>Applies to:</em>

     <td>non-replaced block-level elements (except table elements), table
      cells, and inline-block elements

    <tr>
     <td><em>Inherited:</em>

     <td>no

    <tr>
     <td><em>Percentages:</em>

     <td>N/A

    <tr>
     <td><em>Media:</em>

     <td>visual

    <tr>
     <td><em>Computed&nbsp;value:</em>

     <td>see individual properties
  </table>

  <p>This is a shorthand property for setting &lsquo;<a
   href="#column-width"><code class=property>column-width</code></a>&rsquo;
   and &lsquo;<a href="#column-count"><code
   class=property>column-count</code></a>&rsquo;. Omitted values are set to
   their initial values.

  <div class=example>
   <p>Here are some valid declarations using the &lsquo;<a
    href="#columns0"><code class=property>columns</code></a>&rsquo; property:
    

   <pre>
columns: 12em;      /* column-width: 12em; column-count: auto */
columns: auto 12em; /* column-width: 12em; column-count: auto */
columns: 2;         /* column-width: auto; column-count: 2 */
columns: 2 auto;    /* column-width: auto; column-count: 2 */
columns: auto;      /* column-width: auto; column-count: auto */
columns: auto auto; /* column-width: auto; column-count: auto */
</pre>
  </div>

  <h3 id=pseudo-algorithm><span class=secno>3.4. </span>Pseudo-algorithm</h3>

  <p>The pseudo-algorithm below determines the used values for &lsquo;<a
   href="#column-count"><code class=property>column-count</code></a>&rsquo;
   (N) and &lsquo;<a href="#column-width"><code
   class=property>column-width</code></a>&rsquo; (W). There are two other
   variables in the pseudo-algorithm:

  <ul>
   <li><code>available-width</code>: if the used width of the multi-column
    element has not been determined when the &lsquo;<a
    href="#column-count"><code class=property>column-count</code></a>&rsquo;
    and &lsquo;<a href="#column-width"><code
    class=property>column-width</code></a>&rsquo; must be determined (e.g.,
    if it is floating with a &lsquo;<code class=property>width</code>&rsquo;
    of &lsquo;<code class=property>auto</code>&rsquo; as per CSS 2.1 section
    10.3.5) this variable is <code>unknown</code>, otherwise it is the same
    as the used width of the multi-column element. In vertical text, the used
    height replaces used width in this calculation.

   <li><code>shrink-to-fit</code>: this variable represents the result of a
    <em>shrink-to-fit</em> computation. CSS does not define the exact
    algorithm.
  </ul>

  <p>Two assumptions are being made by the pseudo-algorithm:

  <ul>
   <li>that the block direction is unconstrained

   <li>that no column breaks are added through style sheets
  </ul>

  <p>The <code>floor()</code> function rounds a number to the next smaller
   integer. <!--
<pre>
(01)  if ((column-width = auto) and (column-count = auto)) or
(02)     ((available-width = unknown) and (column-count = auto)) then
(03)    exit; /* no columns */
(04)  fi
(05)  
(06)  if (available-width = unknown) and (column-count != auto) and (column-width != auto) then
(07)    N := column-count;  
(08)    W := column-width;
(09)    exit;
(10)  fi
(11)  
(12)  if (available-width = unknown) then
(13)    available-width := shrink-to-fit;
(14)  fi
(15)  
(16)  if (column-width = auto) then
(18)    N := column-count;
(19)    W := max(0, (available-width - ((N - 1) * column-gap))/N);
(27)  elsif (column-count = auto) then
(28)    if (column-width >= available-width) then
(29)      N := 1
(30)      W := available-width;
(31)    else
(32)      N := floor((available-width + column-gap) / (column-width + column-gap));
(33)      W := ((available-width + column-gap) / N) - column-gap;
(34)    fi
(35)  elsif (column-width >= available-width) then
(36)    N := 1
(37)    W := available-width;
(38)  else
(39)    N := min(column-count, floor((available-width + column-gap) / (column-width + column-gap)))
(40)    W := ((available-width + column-gap) / N) - column-gap;
(41)  fi
</pre>

<p><span class=issue>Alternative encoding of pseudo-algorithm:
-->
   

  <pre>
(01)  if ((column-width = auto) and (column-count = auto)) then
(02)        exit; /* not a multicol element */

(03)  if ((available-width = unknown) and (column-count = auto)) then
(04)    exit; /* no columns */

(05)  if (available-width = unknown) and (column-count != auto) and (column-width != auto) then
(06)    N := column-count;  
(07)    W := column-width;
(08)  exit;

(09)  if (available-width = unknown) then
(10)    available-width := shrink-to-fit;

(11)  if (column-width = auto) and (column-count != auto) then
(12)    N := column-count;
(13)    W := max(0, (available-width - ((N - 1) * column-gap)) / N);
(14)  exit;

(15)  if (column-width != auto) and (column-count = auto) then
(16)    N := max(1, floor((available-width + column-gap) / (column-width + column-gap)));
(17)    W := ((available-width + column-gap) / N) - column-gap;
(18)  exit;

(19)  if (column-width != auto) and (column-count != auto) then
(20)    N := min(column-count, floor((available-width + column-gap) / (column-width + column-gap)))
(21)    W := ((available-width + column-gap) / N) - column-gap;
(22)  exit
</pre>

  <p>In paged media, user agents may perform this calculation on a per-page
   basis.

  <p class=note>Note that, in most cases, only one of &lsquo;<a
   href="#column-width"><code class=property>column-width</code></a>&rsquo;
   and &lsquo;<a href="#column-count"><code
   class=property>column-count</code></a>&rsquo; affect the layout. If
   &lsquo;<a href="#column-width"><code
   class=property>column-width</code></a>&rsquo; has a value other than
   &lsquo;<code class=css>auto</code>&rsquo;, &lsquo;<a
   href="#column-count"><code class=property>column-count</code></a>&rsquo;
   indicates the maximum number of columns. However, both &lsquo;<a
   href="#column-width"><code class=property>column-width</code></a>&rsquo;
   and &lsquo;<a href="#column-count"><code
   class=property>column-count</code></a>&rsquo; are honored when the width
   of the element has not been determined. This can, e.g., be the case for
   table cells and floats.

  <h3 id=stacking-context><span class=secno>3.5. </span>Stacking context</h3>

  <p>All column boxes in a multi-column element are in the same stacking
   context and the drawing order of their contents is as specified in CSS
   2.1.

  <h2 id=column-gaps-and-rules><span class=secno>4. </span>Column gaps and
   rules</h2>

  <p>Column gaps and rules are placed between columns in the same multicol
   element. The length of the column gaps and column rules is equal to the
   length of the columns. Column gaps take up space. That is, column gaps
   will push apart content in adjacent columns (within the same multicol
   element).

  <p>A column rule is drawn in the middle of the column gap with the
   endpoints at opposing content edges of the multicol element. Column rules
   do not take up space. That is, the presence or thickness of a column rule
   will not alter the placement of anything else. If a column rule is wider
   than its gap, the column rule will overlap adjacent column boxes, and
   possibly extend outside the box of the multicol element. Column rules are
   painted just above the background of the multicol element. This allows
   child elements with &lsquo;<code class=property>z-index</code>&rsquo;
   values to be on top of column rules. Column rules are only drawn between
   two columns that both have content.

  <h3 id=column-gap><span class=secno>4.1. </span>&lsquo;<a
   href="#column-gap0"><code class=property>column-gap</code></a>&rsquo;</h3>

  <table class=propdef>
   <tbody>
    <tr>
     <td><em>Name:</em>

     <td><dfn id=column-gap0>column-gap</dfn>

    <tr>
     <td><em>Value:</em>

     <td>&lt;length&gt; | normal

    <tr>
     <td><em>Initial:</em>

     <td>normal

    <tr>
     <td><em>Applies to:</em>

     <td>multicol elements

    <tr>
     <td><em>Inherited:</em>

     <td>no

    <tr>
     <td><em>Percentages:</em>

     <td>N/A

    <tr>
     <td><em>Media:</em>

     <td>visual

    <tr>
     <td><em>Computed&nbsp;value:</em>

     <td>absolute length or &lsquo;<code class=property>normal</code>&rsquo;
  </table>

  <p>The &lsquo;<a href="#column-gap0"><code
   class=property>column-gap</code></a>&rsquo; property sets the gap between
   columns. If there is a column rule between columns, it will appear in the
   middle of the gap.

  <p>The &lsquo;<code class=css>normal</code>&rsquo; value is UA-specific. A
   value of &lsquo;<code class=css>1em</code>&rsquo; is suggested.

  <p>Column gaps cannot be negative.

  <h3 id=crc><span class=secno>4.2. </span>&lsquo;<a
   href="#column-rule-color"><code
   class=property>column-rule-color</code></a>&rsquo;</h3>

  <table class=propdef>
   <tbody>
    <tr>
     <td><em>Name:</em>

     <td><dfn id=column-rule-color>column-rule-color</dfn>

    <tr>
     <td><em>Value:</em>

     <td>&lt;color&gt;

    <tr>
     <td><em>Initial:</em>

     <td>same as for &lsquo;<code class=property>color</code>&rsquo; property
      <a href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>

    <tr>
     <td><em>Applies to:</em>

     <td>multicol elements

    <tr>
     <td><em>Inherited:</em>

     <td>no

    <tr>
     <td><em>Percentages:</em>

     <td>N/A

    <tr>
     <td><em>Media:</em>

     <td>visual

    <tr>
     <td><em>Computed&nbsp;value:</em>

     <td>the same as the computed value for the &lsquo;<code
      class=property>color</code>&rsquo; property <a href="#CSS21"
      rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>
  </table>

  <p>This property sets the color of the column rule. The &lt;color&gt;
   values are defined in <a href="#CSS21"
   rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>.

  <h3 id=crs><span class=secno>4.3. </span>&lsquo;<a
   href="#column-rule-style"><code
   class=property>column-rule-style</code></a>&rsquo;</h3>

  <table class=propdef>
   <tbody>
    <tr>
     <td><em>Name:</em>

     <td><dfn id=column-rule-style>column-rule-style</dfn>

    <tr>
     <td><em>Value:</em>

     <td><a
      href="http://www.w3.org/TR/CSS2/tables.html#table-border-styles">&lt;border-style&gt;</a>
      <!--http://www.w3.org/TR/CSS21/box.html#value-def-border-style-->

    <tr>
     <td><em>Initial:</em>

     <td>none

    <tr>
     <td><em>Applies to:</em>

     <td>multicol elements

    <tr>
     <td><em>Inherited:</em>

     <td>no

    <tr>
     <td><em>Percentages:</em>

     <td>N/A

    <tr>
     <td><em>Media:</em>

     <td>visual

    <tr>
     <td><em>Computed&nbsp;value:</em>

     <td>specified value
  </table>

  <p>The &lsquo;<a href="#column-rule-style"><code
   class=property>column-rule-style</code></a>&rsquo; property sets the style
   of the rule between columns of an element. The &lt;border-style&gt; values
   are defined in <a href="#CSS21"
   rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a> and the values are
   interpreted as in the <a
   href="http://www.w3.org/TR/CSS2/tables.html#collapsing-borders">the
   collapsing border model</a>.

  <p>The &lsquo;<code class=property>none</code>&rsquo; value forces the
   computed value of <span class=property>&lsquo;<a
   href="#column-rule-width"><code
   class=property>column-rule-width</code></a>&rsquo;</span> to be
   &lsquo;<code class=css>0</code>&rsquo;.

  <h3 id=crw><span class=secno>4.4. </span>&lsquo;<a
   href="#column-rule-width"><code
   class=property>column-rule-width</code></a>&rsquo;</h3>

  <table class=propdef>
   <tbody>
    <tr>
     <td><em>Name:</em>

     <td><dfn id=column-rule-width>column-rule-width</dfn>

    <tr>
     <td><em>Value:</em>

     <td><a
      href="http://www.w3.org/TR/CSS21/box.html#value-def-border-width">&lt;border-width&gt;</a>
      

    <tr>
     <td><em>Initial:</em>

     <td>medium

    <tr>
     <td><em>Applies to:</em>

     <td>multicol elements

    <tr>
     <td><em>Inherited:</em>

     <td>no

    <tr>
     <td><em>Percentages:</em>

     <td>N/A

    <tr>
     <td><em>Media:</em>

     <td>visual

    <tr>
     <td><em>Computed&nbsp;value:</em>

     <td>absolute length; &lsquo;<code class=css>0</code>&rsquo; if the
      column rule style is &lsquo;<code class=property>none</code>&rsquo; or
      &lsquo;<code class=property>hidden</code>&rsquo;
  </table>

  <p>This property sets the width of the rule between columns. Negative
   values are not allowed.

  <h3 id=column-rule><span class=secno>4.5. </span>&lsquo;<a
   href="#column-rule0"><code class=property>column-rule</code></a>&rsquo;</h3>

  <table class=propdef>
   <tbody>
    <tr>
     <td><em>Name:</em>

     <td><dfn id=column-rule0>column-rule</dfn>

    <tr>
     <td><em>Value:</em>

     <td><a href="#crw">&lt;&lsquo;<code
      class=property>column-rule-width</code>&rsquo;&gt;</a> || <a
      href="#crs">&lt;&lsquo;<code
      class=property>column-rule-style</code>&rsquo;&gt;</a> || [ <a
      href="#crc">&lt;&lsquo;<code
      class=property>column-rule-color</code>&rsquo;&gt;</a> | transparent ]

    <tr>
     <td><em>Initial:</em>

     <td>see individual properties

    <tr>
     <td><em>Applies to:</em>

     <td>multicol elements

    <tr>
     <td><em>Inherited:</em>

     <td>no

    <tr>
     <td><em>Percentages:</em>

     <td>N/A

    <tr>
     <td><em>Media:</em>

     <td>visual

    <tr>
     <td><em>Computed&nbsp;value:</em>

     <td>see individual properties
  </table>

  <p>This property is a shorthand for setting &lsquo;<a
   href="#column-rule-width"><code
   class=property>column-rule-width</code></a>&rsquo;, &lsquo;<a
   href="#column-rule-style"><code
   class=property>column-rule-style</code></a>&rsquo;, and &lsquo;<a
   href="#column-rule-color"><code
   class=property>column-rule-color</code></a>&rsquo; at the same place in
   the style sheet. Omitted values are set to their initial values.

  <div class=example>
   <p>In this example, the column rule and the column gap have the same
    width. Therefore, they will occupy exactly the same space.

   <pre>
body { 
  column-gap: 1em;
  column-rule-width: 1em;
  column-rule-style: solid;
  column-rule-color: black;
}
</pre>
  </div>

  <div class=example>
   <p>If a tall image is moved to a column on the next page to find room for
    it, its natural column may be left empty. If so, the column is is still
    considered to have content for the purpose of deciding if the column rule
    should be drawn.
  </div>

  <h2 id=column-breaks><span class=secno>5. </span>Column breaks</h2>

  <p>When content is laid out in multiple columns, the user agent must
   determine where column breaks are placed. The problem of breaking content
   into columns is similar to breaking content into pages.

  <p>Three new properties are introduced to allow column breaks to be
   described in the same properties as page breaks: &lsquo;<a
   href="#break-before"><code class=property>break-before</code></a>&rsquo;,
   &lsquo;<a href="#break-after"><code
   class=property>break-after</code></a>&rsquo;, and &lsquo;<a
   href="#break-inside"><code class=property>break-inside</code></a>&rsquo;.
   These properties take the same values as &lsquo;<code
   class=property>page-break-before</code>&rsquo;, &lsquo;<code
   class=property>page-break-after</code>&rsquo;, and &lsquo;<code
   class=property>page-break-inside</code>&rsquo; <a href="#CSS21"
   rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>. In addition, some new
   keyword values are added.

  <h3 id=break-before-break-after-break-inside><span class=secno>5.1.
   </span>&lsquo;<a href="#break-before"><code
   class=property>break-before</code></a>&rsquo;, &lsquo;<a
   href="#break-after"><code class=property>break-after</code></a>&rsquo;,
   &lsquo;<a href="#break-inside"><code
   class=property>break-inside</code></a>&rsquo;</h3>

  <table class=propdef>
   <tbody>
    <tr>
     <td><em>Name:</em>

     <td><dfn id=break-before>break-before</dfn>

    <tr>
     <td><em>Value:</em>

     <td>auto | always | avoid | left | right | page | column | avoid-page |
      avoid-column

    <tr>
     <td><em>Initial:</em>

     <td>auto

    <tr>
     <td><em>Applies to:</em>

     <td>block-level elements

    <tr>
     <td><em>Inherited:</em>

     <td>no

    <tr>
     <td><em>Percentages:</em>

     <td>N/A

    <tr>
     <td><em>Media:</em>

     <td>paged

    <tr>
     <td><em>Computed&nbsp;value:</em>

     <td>specified value
  </table>

  <table class=propdef>
   <tbody>
    <tr>
     <td><em>Name:</em>

     <td><dfn id=break-after>break-after</dfn>

    <tr>
     <td><em>Value:</em>

     <td>auto | always | avoid | left | right | page | column | avoid-page |
      avoid-column

    <tr>
     <td><em>Initial:</em>

     <td>auto

    <tr>
     <td><em>Applies to:</em>

     <td>block-level elements

    <tr>
     <td><em>Inherited:</em>

     <td>no

    <tr>
     <td><em>Percentages:</em>

     <td>N/A

    <tr>
     <td><em>Media:</em>

     <td>paged

    <tr>
     <td><em>Computed&nbsp;value:</em>

     <td>specified value
  </table>

  <table class=propdef>
   <tbody>
    <tr>
     <td><em>Name:</em>

     <td><dfn id=break-inside>break-inside</dfn>

    <tr>
     <td><em>Value:</em>

     <td>auto | avoid | avoid-page | avoid-column

    <tr>
     <td><em>Initial:</em>

     <td>auto

    <tr>
     <td><em>Applies to:</em>

     <td>block-level elements

    <tr>
     <td><em>Inherited:</em>

     <td>no

    <tr>
     <td><em>Percentages:</em>

     <td>N/A

    <tr>
     <td><em>Media:</em>

     <td>paged

    <tr>
     <td><em>Computed&nbsp;value:</em>

     <td>specified value
  </table>

  <p>These properties describe page/column break behavior before/after/inside
   the generated box. These values are normatively defined in <a
   href="#CSS21" rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>:

  <dl>
   <dt>auto

   <dd>Neither force nor forbid a page/column break before (after, inside)
    the generated box.

   <dt>always

   <dd>Always force a page break before (after) the generated box.

   <dt>avoid

   <dd>Avoid a page/column break before (after, inside) the generated box.

   <dt>left

   <dd>Force one or two page breaks before (after) the generated box so that
    the next page is formatted as a left page.

   <dt>right

   <dd>Force one or two page breaks before (after) the generated box so that
    the next page is formatted as a right page.
  </dl>

  <p>This specification adds the following new values:

  <dl>
   <dt>page

   <dd>Always force a page break before (after) the generated box.

   <dt>column

   <dd>Always force a column break before (after) the generated box.

   <dt>avoid-page

   <dd>Avoid a page break before (after, inside) the generated box.

   <dt>avoid-column

   <dd>Avoid a column break before (after, inside) the generated box.
  </dl>

  <p>When a page or column break splits a box, the box's margins, borders,
   and padding have no visual effect where the split occurs. However, the
   margin immediately after a forced page/column break will be preserved. A
   forced page/column break is a break that does not occur naturally.

  <p class=note>In the future, new properties may describe alternate ways to
   handle margins, borders and padding around page/column breaks.

  <div class=example>
   <p>In this example, forced column breaks appear before <code>h2</code>
    elements and after <code>img</code> elements:

   <pre>
.multicol { column-width: 8em }
.multicol h2 { break-before: column; margin-top: 2em }
.multicol img { break-after: column }
</pre>

   <p>The top margin of <code>h2</code> elements will be preserved since the
    column break is forced.
  </div>

  <div class=example>
   <p>In this example, the formatter will try avoid column breaks inside
    <code>p</code> elements:

   <pre>
p { break-inside: avoid-column }
</pre>
  </div>

  <h2 id=spanning-columns><span class=secno>6. </span>Spanning columns</h2>

  <p>The &lsquo;<a href="#column-span0"><code
   class=property>column-span</code></a>&rsquo; property makes it possible
   for an element to span across several columns.

  <h3 id=column-span><span class=secno>6.1. </span>&lsquo;<a
   href="#column-span0"><code class=property>column-span</code></a>&rsquo;</h3>

  <table class=propdef>
   <tbody>
    <tr>
     <td><em>Name:</em>

     <td><dfn id=column-span0>column-span</dfn>

    <tr>
     <td><em>Value:</em>

     <td>none | all

    <tr>
     <td><em>Initial:</em>

     <td>none

    <tr>
     <td><em>Applies to:</em> <!--
      <td>static, non-floating elements, 
-->
      

     <td>block-level elements, except floating and absolutely positioned
      elements

    <tr>
     <td><em>Inherited:</em>

     <td>no

    <tr>
     <td><em>Percentages:</em>

     <td>N/A

    <tr>
     <td><em>Media:</em>

     <td>visual

    <tr>
     <td><em>Computed&nbsp;value:</em>

     <td>as specified
  </table>

  <p>This property describes how many columns an element spans across. Values
   are:

  <dl>
   <dt>none

   <dd>The element does not span multiple columns.

   <dt>all

   <dd>The element spans across all columns. Content in the normal flow that
    appears before the element is automatically balanced across all columns
    before the element appears. The element establishes a new block
    formatting context.
  </dl>

  <p>An element that spans more than one column is called a <dfn
   id=spanning-element>spanning element</dfn>. <!--
<p>This property has no effect on elements that do not fit entirely
within the multicol element. Also, if a setting on this property pushes the
element outside a multicol element, this property will have no effect.
-->
   

  <div class=example>
   <p>In this example, an <code>h2</code> element has been added to the
    sample document after the first sentence in the fourth sentence (i.e.,
    after the word "jkl."). This styling applies:

   <pre class=css>
h2 { column-span: all; background: silver } 
img { display: none }
</pre>

   <p>By setting &lsquo;<a href="#column-span0"><code
    class=property>column-span</code></a>&rsquo; to &lsquo;<code
    class=css>all</code>&rsquo;, all content that appear before the
    <code>h2</code> element is shown before the <code>h2</code> element.

   <div class=cols>
    <p>Ab cde fgh i jkl. Mno<br>
     pqr stu vw xyz. A bc<br>
     <br>
     <br>
     M nop qrst uv wx yz.<br>
     Ab cde fgh i jkl. Mno<br>
     pqr stu vw xyz. A bc<br>
     def g hij klm nopqrs<br>
     tuv wxy z. Abc de fg<br>
     hi jklmno. Pqrstu vw<br>

    <div class=col style="left: 175px">
     <p>def g hij klm nopqrs<br>
      tuv wxy z. Abc de fg<br>
      <br>
      <br>
      x yz. Abc def ghi jkl.<br>
      M nop qrst uv wx yz.<br>
      Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs<br>
      tuv wxy z. Abc de fg<br>
    </div>

    <div class=col style="left: 350px">
     <p> hi jklmno. Pqrstu vw<br>
      x yz. Abc def ghi jkl.<br>
      <br>
      <br>
      hi jklmno. Pqrstu vw<br>
      x yz. Abc def ghi jkl.<br>
      M nop qrst uv wx yz.<br>
      Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz.
    </div>

    <div class=rep style="width: 490px; height: 20px; background: silver;
     font-size: 1.5em; padding: 5px">An H2 element</div>

    <div class=gap style="left: 150px"></div>

    <div class=gap style="left: 325px"></div>
   </div>
  </div>

  <p>A spanning element takes up more space than the element would take up
   otherwise. When space is limited, it may be impossible to find room for
   the spanning element. In these cases, user agents may treat the element as
   if &lsquo;<code class=property>none</code>&rsquo; had been specified on
   this property.

  <div class=example>
   <p>This is a variation of the previous example. In this example, the H2
    element appears later in the content, and the height of the multicol
    element is constrained. Therefore, the H2 element appears in the overflow
    and there is not room to make the element spanning. As a result, the
    element appears as if &lsquo;<code class=css>column-span:
    none</code>&rsquo; was specified.

   <div class=cols style="height: 100px">
    <div class=col style="">
     <p> Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs<br>
      tuv wxy z. Abc de fg<br>
      hi jklmno. Pqrstu vw<br>
    </div>

    <div class=col style="left: 175px">
     <p> x yz. Abc def ghi jkl.<br>
      M nop qrst uv wx yz.<br>
      Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs
    </div>

    <div class=col style="left: 350px">
     <p> tuv wxy z. Abc de fg<br>
      hi jklmno. Pqrstu vw<br>
      x yz. Abc def ghi jkl.<br>
      M nop qrst uv wx yz.<br>
      Ab cde fgh i jkl. Mno<br>
    </div>

    <div class=col style="left: 525px">
     <p>pqr stu vw xyz.

     <div class=rep style="width: 140px; height: 40px; background: silver;
      font-size: 1.5em; padding: 5px; margin: 0; position: static">An H2
      element</div>
     A bc def g hij klm</div>

    <div class=col style="left: 700px"> nopqrs tuv wxy z.</div>

    <div class=gap style="left: 150px"></div>

    <div class=gap style="left: 325px"></div>

    <div class=gap style="left: 500px"></div>

    <div class=gap style="left: 675px"></div>
   </div>
  </div>

  <h2 id=filling-columns><span class=secno>7. </span>Filling columns</h2>

  <p>There are two strategies for filling columns: columns can either be
   balanced, or not. If columns are balanced, UAs should minimize the
   variation in column length. Otherwise, columns are filled sequentially and
   some columns may end up partially filled, or with no content at all. In
   any case, the user agent should try to honor the &lsquo;<code
   class=property>widows</code>&rsquo; and &lsquo;<code
   class=property>orphans</code>&rsquo; properties.

  <h3 id=cf><span class=secno>7.1. </span>&lsquo;<a href="#column-fill"><code
   class=property>column-fill</code></a>&rsquo;</h3>

  <table class=propdef>
   <tbody>
    <tr>
     <td><em>Name:</em>

     <td><dfn id=column-fill>column-fill</dfn>

    <tr>
     <td><em>Value:</em>

     <td>auto | balance

    <tr>
     <td><em>Initial:</em>

     <td>balance

    <tr>
     <td><em>Applies to:</em>

     <td>multicol elements

    <tr>
     <td><em>Inherited:</em>

     <td>no

    <tr>
     <td><em>Percentages:</em>

     <td>N/A

    <tr>
     <td><em>Media:</em>

     <td>see below

    <tr>
     <td><em>Computed&nbsp;value:</em>

     <td>as specified
  </table>

  <p>The values are:

  <dl>
   <dt>balance

   <dd>Balance content equally between columns, if possible.

   <dt>auto

   <dd>Fills columns sequentially.
  </dl>

  <p>In continuous media, this property will only be consulted if the length
   of columns has been constrained. Otherwise, columns will automatically be
   balanced.

  <p>In continous media, this property does not have any effect in overflow
   columns (see below).

  <p>In paged media, this property will only have effect on the last page the
   multicol element appears on.

  <h2 id=overflow><span class=secno>8. </span>Overflow</h2>

  <h3 id=overflow-inside-multicol-elements><span class=secno>8.1.
   </span>Overflow inside multicol elements</h3>

  <p>Content in the normal flow that extends into column gaps (e.g., long
   words or images) is clipped in the middle of the column gap.

  <div class=example>
   <p>In this example, the black image is wider than the column, and is
    therefore clipped.

   <div class=cols>
    <p>Lorem ipsum dolor<br>
     sit amet. Nam at jus. <br>
     <br>
     <br>
     <br>
     <br>
     <br>
     <br>
     Sed imp er di et ris.<br>
     Cur abi tur et sapen.

    <div style="position: absolute; left: 175px; top: 0; z-index: 6;">
     <p>Lorem ipsum dolor<br>
      sit amet. Nam at jus.<br>
      Sed imp er di et ris.<br>
      Cur abi tur et sapen.<br>
      Vivamus a metus.<br>
      Aenean at risus<br>
      pharetra ante luctu<br>
      feugiat quis enim.<br>
      Cum sociis natoque<br>
      penatibus et magni.
    </div>

    <div style="position: absolute; left: 350px; top: 0; z-index: 6;">
     <p>Lorem ipsum dolor<br>
      sit amet. Nam at jus.<br>
      Sed imp er di et ris.<br>
      Cur abi tur et sapen.<br>
      Vivamus a metus.<br>
      Aenean at risus<br>
      pharetra ante luctu<br>
      feugiat quis enim.<br>
      Cum sociis natoque<br>
      penatibus et magni.
    </div>

    <div class=rep style="width: 163px"></div>

    <div class=gap style="left: 150px"></div>

    <div class=gap style="left: 325px"></div>
   </div>
  </div>

  <h3 id=pagination-and-overflow-outside-multicol><span class=secno>8.2.
   </span>Pagination and overflow outside multicol elements</h3>

  <p>Content and column rules that extend outside column boxes at the edges
   of the multi-column element are clipped according to the &lsquo;<code
   class=property>overflow</code>&rsquo; property.

  <p>A multicol element can have more columns than it has room for due to:

  <ul>
   <li>a declaration that constrains the column height (e.g., using
    &lsquo;<code class=property>height</code>&rsquo; or &lsquo;<code
    class=property>max-height</code>&rsquo;). In this case, additional column
    boxes are created in the inline direction

   <li>the size of the page. In this case, additional column boxes are moved
    to the next page(s).

   <li>explicit column breaks. In this case, additional column boxes are
    created in the inline direction for continous media, and additional
    column boxes are moved to the next page(s) for paged media.
  </ul>

  <p>Columns that appear outside the multicol element in continous media are
   called <dfn id=overflow-columns>overflow columns</dfn>.

  <div class=example>
   <p>In this example, the height of the multi-column element has been
    constrained to a maximum height. Also, the style sheet specifies that
    overflowing content should be visible:

   <pre class=css>
div { 
  max-height: 5em;
  overflow: visible;
}
</pre>

   <p>As a result, the number of columns is increased.

   <div class=cols style="height: 100px">
    <div class=col style="">
     <p> Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs<br>
      tuv wxy z. Abc de fg<br>
      hi jklmno. Pqrstu vw<br>
    </div>

    <div class=col style="left: 175px">
     <p> x yz. Abc def ghi jkl.<br>
      M nop qrst uv wx yz.<br>
      Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs
    </div>

    <div class=col style="left: 350px">
     <p> tuv wxy z. Abc de fg<br>
      hi jklmno. Pqrstu vw<br>
      x yz. Abc def ghi jkl.<br>
      M nop qrst uv wx yz.<br>
      Ab cde fgh i jkl. Mno<br>
    </div>

    <div class=col style="left: 525px">
     <p> pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs<br>
      tuv wxy z. Abc de fg<br>
      hi jklmno. Pqrstu vw<br>
      x yz. Abc def ghi jkl.<br>
    </div>

    <div class=gap style="left: 150px"></div>

    <div class=gap style="left: 325px"></div>

    <div class=gap style="left: 500px"></div>
   </div>
  </div>

  <div class=example>
   <p>In this example, explicit column breaks are generated after paragraphs:
    

   <pre class=css>
p { 
  break-after: column;
}
</pre>

   <p>As a result, the number of columns increases and the extra columns
    added in the inline direction:

   <div class=cols style="height: 100px">
    <div class=col style="">
     <p> Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz.
    </div>

    <div class=col style="left: 175px">
     <p> Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs<br>
      tuv wxy z.
    </div>

    <div class=col style="left: 350px">
     <p> Ab cde fgh i jkl mno.<br>
    </div>

    <div class=col style="left: 525px">
     <p> Pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs<br>
      tuv wxy z. Abc de fg<br>
      hi jklmno pqr stu v<br>
      wx yz.
    </div>

    <div class=gap style="left: 150px"></div>

    <div class=gap style="left: 325px"></div>

    <div class=gap style="left: 500px"></div>
   </div>
  </div>

  <div class=example>
   <p>In paged media, extra columns are shown on the next page. Given the
    same code as the previous example:

   <pre class=css>
p { 
  break-after: column;
}
</pre>

   <p>As a result, the number of columns is increased and placed on the next
    page. This would appear on the first page:

   <div class=cols style="height: 80px; border-bottom: none">
    <div class=col style="">
     <p> Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz.
    </div>

    <div class=col style="left: 175px">
     <p> Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs<br>
      tuv wxy z.
    </div>

    <div class=col style="left: 350px">
     <p> Ab cde fgh i jkl.<br>
    </div>

    <div class=gap style="left: 150px"></div>

    <div class=gap style="left: 325px"></div>
   </div>

   <p>This would appear on the second page:

   <div class=cols style="height: 100px; border-top: none">
    <div class=col style="">
     <p> Ab cde fgh i jkl. Mno<br>
      pqr stu vw xyz. A bc<br>
      def g hij klm nopqrs<br>
      tuv wxy z. Abc de fg<br>
      hi jklmno.<br>
    </div>

    <div class=gap style="left: 150px"></div>

    <div class=gap style="left: 325px"></div>
   </div>
  </div>

  <h2 id=conformance><span class=secno>9. </span>Conformance</h2>

  <p>Conforming UAs must flow the content of an element into several columns
   according to this specification.

  <p>The conformance requirements are expressed with a combination of
   descriptive assertions and RFC 2119 terminology. The key words "MUST",
   "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
   "RECOMMENDED", "MAY", and "OPTIONAL" in the normative parts of this
   document are to be interpreted as described in RFC 2119. However, for
   readability, these words do not appear in all uppercase letters in this
   specification. All of the text of this specification is normative except
   sections explicitly marked as non-normative, examples, and notes. <a
   href="#RFC2119" rel=biblioentry>[RFC2119]<!--{{!RFC2119}}--></a>

  <h3 id=cr-exit-criteria><span class=secno>9.1. </span>CR exit criteria</h3>

  <p>As described in the W3C process document, a <a
   href="http://www.w3.org/2005/10/Process-20051014/tr.html#cfi">Candidate
   Recommendation</a> (CR) is a specification that W3C recommends for use on
   the Web. The next stage is <em>Recommendation</em>, when the specification
   is sufficiently implemented.

  <p>For this specification to be proposed as a W3C Recommendation, the
   following conditions shall be met. There must be at least two independent,
   interoperable implementations of each feature. Each feature may be
   implemented by a different set of products, there is no requirement that
   all features be implemented by a single product. For the purposes of this
   criterion, we define the following terms:

  <dl>
   <dt>independent

   <dd>each implementation must be developed by a different party and cannot
    share, reuse, or derive from code used by another qualifying
    implementation. Sections of code that have no bearing on the
    implementation of this specification are exempt from this requirement.

   <dt>interoperable

   <dd>passing the respective test case(s) in the official CSS test suite,
    or, if the implementation is not a Web browser, an equivalent test. Every
    relevant test in the test suite should have an equivalent test created if
    such a user agent (UA) is to be used to claim interoperability. In
    addition if such a UA is to be used to claim interoperability, then there
    must one or more additional UAs which can also pass those equivalent
    tests in the same way for the purpose of interoperability. The equivalent
    tests must be made publicly available for the purposes of peer review.

   <dt>implementation

   <dd>a user agent which:
    <ol class=inline>
     <li>implements the specification.

     <li>is available to the general public. The implementation may be a
      shipping product or other publicly available version (i.e., beta
      version, preview release, or <em>nightly build</em>). Non-shipping
      product releases must have implemented the feature(s) for a period of
      at least one month in order to demonstrate stability.

     <li>is not experimental (i.e., a version specifically designed to pass
      the test suite and is not intended for normal usage going forward).
    </ol>
  </dl>

  <p>A minimum of sixth months of the CR period must have elapsed. This is to
   ensure that enough time is given for any remaining major errors to be
   caught.

  <p>Features will be dropped if two or more interoperable implementations
   are not found by the end of the CR period.

  <p>Features may/will also be dropped if adequate/sufficient (by judgment of
   CSS WG) tests have not been produced for those feature(s) by the end of
   the CR period.

  <h2 class=no-num id=acknowledgments>Acknowledgments</h2>

  <p>This document is based on several older proposals and comments on older
   proposals. Contributors include Øyvind Stenhaug, Sylvain Galineau,
   Giovanni Campagna, David Hyatt, David Singer, David Woolley, Elika Etemad,
   Bj&ouml;rn H&ouml;hrmann, Joost de Valk, Peter-Paul Koch, Shelby Moore,
   Till Halbach, C&eacute;dric Savarese, Andy Clarke, Robert O'Callahan,
   Markus Mielke, Alex Mogilevsky, Sergey Genkin, Michael Day, Melinda Grant,
   Kevin Lawver, David Baron, Bert Bos, Dave Raggett, Chris Wilson, Robert
   Stevahn, Peter Linss, Chris Lilley, Steve Zilles, Tantek &Ccedil;elik,
   Daniel Glazman and Ian Hickson.

  <h2 class=no-num id=references>References</h2>

  <h3 class=no-num id=normative-references>Normative references</h3>
  <!--begin-normative-->
  <!-- Sorted by label -->

  <dl class=bibliography>
   <dt style="display: none"><!-- keeps the doc valid if the DL is empty -->
    <!---->

   <dt id=CSS21>[CSS21]

   <dd>Bert Bos; et al. <a
    href="http://www.w3.org/TR/2010/WD-CSS2-20101207"><cite>Cascading Style
    Sheets Level 2 Revision 1 (CSS 2.1) Specification.</cite></a> 7 December
    2010. W3C Working Draft. (Work in progress.) URL: <a
    href="http://www.w3.org/TR/2010/WD-CSS2-20101207">http://www.w3.org/TR/2010/WD-CSS2-20101207</a>
    </dd>
   <!---->

   <dt id=RFC2119>[RFC2119]

   <dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key
    words for use in RFCs to Indicate Requirement Levels.</cite></a> Internet
    RFC 2119. URL: <a
    href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>
    </dd>
   <!---->
  </dl>
  <!--end-normative-->

  <h3 class=no-num id=other-references>Other references</h3>
  <!--begin-informative-->
  <!-- Sorted by label -->

  <dl class=bibliography>
   <dt style="display: none"><!-- keeps the doc valid if the DL is empty -->
    <!---->
  </dl>
  <!--end-informative-->

  <h2 class=no-num id=index>Index</h2>
  <!--begin-index-->

  <ul class=indexlist>
   <li>break-after, <a href="#break-after"
    title=break-after><strong>5.1.</strong></a>

   <li>break-before, <a href="#break-before"
    title=break-before><strong>5.1.</strong></a>

   <li>break-inside, <a href="#break-inside"
    title=break-inside><strong>5.1.</strong></a>

   <li>column box, <a href="#column-box" title="column
    box"><strong>2.</strong></a>

   <li>column-count, <a href="#column-count"
    title=column-count><strong>3.2.</strong></a>

   <li>column-fill, <a href="#column-fill"
    title=column-fill><strong>7.1.</strong></a>

   <li>column-gap, <a href="#column-gap0"
    title=column-gap><strong>4.1.</strong></a>

   <li>column-rule, <a href="#column-rule0"
    title=column-rule><strong>4.5.</strong></a>

   <li>column-rule-color, <a href="#column-rule-color"
    title=column-rule-color><strong>4.2.</strong></a>

   <li>column-rule-style, <a href="#column-rule-style"
    title=column-rule-style><strong>4.3.</strong></a>

   <li>column-rule-width, <a href="#column-rule-width"
    title=column-rule-width><strong>4.4.</strong></a>

   <li>columns, <a href="#columns0" title=columns><strong>3.3.</strong></a>

   <li>column-span, <a href="#column-span0"
    title=column-span><strong>6.1.</strong></a>

   <li>column-width, <a href="#column-width"
    title=column-width><strong>3.1.</strong></a>

   <li>multi-column element, <a href="#multi-column-element"
    title="multi-column element"><strong>2.</strong></a>

   <li>overflow columns, <a href="#overflow-columns" title="overflow
    columns"><strong>8.2.</strong></a>

   <li>spanning element, <a href="#spanning-element" title="spanning
    element"><strong>6.1.</strong></a>
  </ul>
  <!--end-index-->

  <h2 class=no-num id=property-index>Property index</h2>
  <!--begin-properties-->

  <table class=proptable>
   <thead>
    <tr>
     <th>Property

     <th>Values

     <th>Initial

     <th>Applies&nbsp;to

     <th>Inh.

     <th>Percentages

     <th>Media

   <tbody>
    <tr valign=baseline>
     <td><a class=property href="#break-after">break-after</a>

     <td>auto | always | avoid | left | right | page | column | avoid-page |
      avoid-column

     <td>auto

     <td>block-level elements

     <td>no

     <td>N/A

     <td>paged

    <tr valign=baseline>
     <td><a class=property href="#break-before">break-before</a>

     <td>auto | always | avoid | left | right | page | column | avoid-page |
      avoid-column

     <td>auto

     <td>block-level elements

     <td>no

     <td>N/A

     <td>paged

    <tr valign=baseline>
     <td><a class=property href="#break-inside">break-inside</a>

     <td>auto | avoid | avoid-page | avoid-column

     <td>auto

     <td>block-level elements

     <td>no

     <td>N/A

     <td>paged

    <tr valign=baseline>
     <td><a class=property href="#column-count">column-count</a>

     <td>&lt;integer&gt; | auto

     <td>auto

     <td>non-replaced block-level elements (except table elements), table
      cells, and inline-block elements

     <td>no

     <td>N/A

     <td>visual

    <tr valign=baseline>
     <td><a class=property href="#column-fill">column-fill</a>

     <td>auto | balance

     <td>balance

     <td>multicol elements

     <td>no

     <td>N/A

     <td>see below

    <tr valign=baseline>
     <td><a class=property href="#column-gap0">column-gap</a>

     <td>&lt;length&gt; | normal

     <td>normal

     <td>multicol elements

     <td>no

     <td>N/A

     <td>visual

    <tr valign=baseline>
     <td><a class=property href="#column-rule0">column-rule</a>

     <td>&lt;&lsquo;column-rule-width&rsquo;&gt; ||
      &lt;&lsquo;column-rule-style&rsquo;&gt; || [
      &lt;&lsquo;column-rule-color&rsquo;&gt; | transparent ]

     <td>see individual properties

     <td>multicol elements

     <td>no

     <td>N/A

     <td>visual

    <tr valign=baseline>
     <td><a class=property href="#column-rule-color">column-rule-color</a>

     <td>&lt;color&gt;

     <td>same as for &lsquo;color&rsquo; property [CSS21]

     <td>multicol elements

     <td>no

     <td>N/A

     <td>visual

    <tr valign=baseline>
     <td><a class=property href="#column-rule-style">column-rule-style</a>

     <td>&lt;border-style&gt;

     <td>none

     <td>multicol elements

     <td>no

     <td>N/A

     <td>visual

    <tr valign=baseline>
     <td><a class=property href="#column-rule-width">column-rule-width</a>

     <td>&lt;border-width&gt;

     <td>medium

     <td>multicol elements

     <td>no

     <td>N/A

     <td>visual

    <tr valign=baseline>
     <td><a class=property href="#columns0">columns</a>

     <td>&lt;&lsquo;column-width&rsquo;> || &lt;&lsquo;column-count&rsquo;>

     <td>see individual properties

     <td>non-replaced block-level elements (except table elements), table
      cells, and inline-block elements

     <td>no

     <td>N/A

     <td>visual

    <tr valign=baseline>
     <td><a class=property href="#column-span0">column-span</a>

     <td>none | all

     <td>none

     <td>block-level elements, except floating and absolutely positioned
      elements

     <td>no

     <td>N/A

     <td>visual

    <tr valign=baseline>
     <td><a class=property href="#column-width">column-width</a>

     <td>&lt;length&gt; | auto

     <td>auto

     <td>non-replaced block-level elements (except table elements), table
      cells, and inline-block elements

     <td>no

     <td>N/A

     <td>visual
  </table>
  <!--end-properties-->
</html>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-declaration:"~/SGML/HTML4.decl"
sgml-default-doctype-name:"html"
sgml-minimize-attributes:t
sgml-nofill-elements:("pre" "style" "br")
sgml-live-element-indicator:t
sgml-omittag:nil
sgml-shorttag:nil
sgml-namecase-general:t
sgml-general-insert-case:lower
sgml-always-quote-attributes:t
sgml-indent-step:nil
sgml-indent-data:t
sgml-parent-document:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->