html-attribute-010

Attribute 'cols' vs CSS 'width' specificity

WeasyPrint

This browser

Assertion
Attribute 'cols' has a specificity of zero and is overridden by CSS.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3     <head>
 4         <title>CSS Test: Attribute 'cols' vs CSS 'width' specificity</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/cascade.html#preshint">
 7         <meta name="flags" content="">
 8         <meta name="assert" content="Attribute 'cols' has a specificity of zero and is overridden by CSS.">
 9         <style type="text/css">
10             html, body, p, br, div
11             {
12                 border: none;
13                 width: auto;
14             }
15             *
16             {
17                 border: 1px solid blue;
18                 padding: 0;
19                 width: 100px;
20             }
21             div div
22             {
23                 background: orange;
24                 height: 20px;
25                 width: 102px;
26             }
27         </style>
28     </head>
29     <body>
30         <p>Test passes if the width of the blue box is the same as the orange bar below.</p>
31         <div>
32             <textarea cols="500" rows="10"></textarea>
33             <div></div>
34         </div>
35     </body>
36 </html>