Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |
Sets or retrieves the weight of the font of the object .
Syntax
{ font-weight : sWeight } |
object . style.fontWeight [ = sWeight ] |
Possible Values
sWeight | String that specifies or receives one of the following values.
|
The property is read/write for all objects except the following, for which it is read-only: currentStyle . The property has a default value of normal . The Cascading Style Sheets (CSS) attribute is inherited.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see About Dynamic Properties .
Remarks
Keywords for font-weight values are mapped to specific font variations depending on the fonts that are installed on the user's computer. In many cases, the user cannot see the difference between different font-weight settings because the system chooses the closest match.
Setting the font-weight to 400 is equivalent to normal , and to 700 is equivalent to bold . An font-weight of bolder or lighter is interpreted relative to the parent object's weight. A value of bolder for text whose parent is normal sets the text to bold.
Microsoft® Internet Explorer 4.0 supports only normal and bold .
Internet Explorer 3.0 supports the font-weight attribute through the font attribute.
Examples
The following examples use the font-weight attribute and the fontWeight property to change the font weight.This example uses li as a selector in an embedded (global) style sheet to set the font weight to bolder .
<STYLE> LI { font-weight :bolder } </STYLE>This example uses inline scripting to set the font weight to bolder when an onmouseover event occurs.
<P STYLE="font-size:14" onmouseover="this.style. fontWeight ='bolder'">Standards Information
This property is defined in Cascading Style Sheets (CSS), Level 1 (CSS1) .
Applies To
|
A , ADDRESS , B , BIG , BLOCKQUOTE , BODY , BUTTON , CAPTION , CENTER , CITE , CODE , COL , COLGROUP , currentStyle , CUSTOM , DD , defaults , DFN , DIR , DIV , DL , DT , EM , FIELDSET , FORM , hn , HTML , I , IMG , INPUT type=button , INPUT type=checkbox , INPUT type=file , INPUT type=image , INPUT type=password , INPUT type=radio , INPUT type=reset , INPUT type=submit , INPUT type=text , ISINDEX , KBD , LABEL , LEGEND , LI , LISTING , MARQUEE , MENU , OL , P , PLAINTEXT , PRE , runtimeStyle , S , SAMP , SELECT , SMALL , SPAN , STRIKE , STRONG , style , SUB , SUP , TABLE , TBODY , TD , TEXTAREA , TFOOT , TH , THEAD , TR , TT , U , UL , VAR , XMP |
Home | Top | Free Ajax Editor | JavaScript Editor | Get Advanced JavaScript and Ajax Editor, Validator and Debugger! 1st JavaScript Editor. |