Forum Moderators: not2easy
input .box {
float: right;
font-size: 1em;
width: 100px;
border: 1px solid red;
}
label {
float: right;
width: 5em;
font-size: .7em;
line-height: 2;
}
The above styles when passed through the CSS validator, give this error message:
Line: 36 Context : label
Invalid number : line-height Parse Error - [empty string]
I checked out the w3.org website, but still don't understand what "empty string" refers to. The page validates as XHTML 1.0 Strict, and renders exactly as I anticipated in FF/IE/Opera. What error have I made here?
The three rules in the example below have the same resultant line height:
DIV { line-height: 1.2; font-size: 10pt } /* number */
DIV { line-height: 1.2em; font-size: 10pt } /* length */
DIV { line-height: 120%; font-size: 10pt } /* percentage */
[w3.org...]
~ line-height is one of those little anomalies and the 2 actually means 2 x the font size, or 200% of it.
sc112, it's a validator bug, apparently reported some time ago by Dave Shea too (Oct'05)
and also, though I haven't tested it, I read the error report can be avoided by putting 2.0 instead of just 2, would you like to try that and report back?