HTML and CSS Reference
In-Depth Information
Moreover, as we mentioned previously, you may omit the tag name, as
well as the document and tags properties for inline JSS, using the style
Capitalization and case are significant in JSS. The tag names within the
tags property must always be fully capitalized. The embedded capital
letters within the tag properties are significant: any deviation from the
exact lettering produces an error, and Netscape won't honor your JSS
declaration. All of the following JSS definitions are invalid, though the
reasons are not overly apparent:
tags.p.fontsize = '12pt';
tags.Body.Color = 'blue';
tags.P.COLOR = 'red';
The correct versions are:
tags.P.fontSize = '12pt';
tags.BODY.color = 'blue';
tags.P.color = 'red';
It can be very tedious to specify a number of properties for a single tag,
so you can take advantage of the JavaScript with statement to reduce
your typing burden. These styles:
tags.P.fontSize = '14pt';
tags.P.color = 'blue';
tags.P.fontWeight = 'bold';
tags.P.leftMargin = '20%';
can more easily be written as:
with (tags.P) {
fontSize = '14pt';
Search WWH ::

Custom Search