The Style property is used to change the styles of HTML elements.
This text was in Verdana and redthis text are in times and bluethis text is a pixels high
The Style property of HTML
The role of the style property:
Provides a common way to change the style of all HTML elements.
The style is introduced in HTML 4, which is a new preferred way to change the style of HTML elements. HTML styles enable you to add styles directly to HTML elements by using the Style property, or indirectly in a separate style sheet (CSS file).
Deprecated tags and attributes
In HTML 4, there are a number of tags and attributes that are deprecated. Deprecated (Deprecated) means that these tags and attributes will not be supported in future versions of HTML and XHTML.
The message here is clear: Avoid using these deprecated tags and attributes!
You should avoid using these tags and attributes:
label |
Description |
<center> |
Defines the centered content. |
<font> and <basefont> |
Defines the HTML font. |
<s> and <strike> |
Define strikethrough text |
<u> |
Define the underlined text |
Properties |
Description |
Align |
Define the alignment of text |
BgColor |
Define background color |
Color |
Define text color |
For these tags and attributes: Please use style instead!
HTML Style instance-background color
The Background-color property defines the background color for the element:
The style attribute obsolete the "old" bgcolor property.
HTML Style instances-fonts, colors, and dimensionsThe font-family, color, and Font-size properties define font families, colors, and font sizes for the text in the element, respectively:
<HTML><BODY><H1 style= "Font-family:verdana" >a heading
The style attribute obsolete the old <font> tag.
HTML Style Instance-text alignmentThe Text-align property specifies the horizontal alignment of the text in the element:
<HTML><BODY><H1 style= "Text-align:center" >this is a heading
The style attribute obsolete the old "align" attribute.
From: http://www.w3school.com.cn/html/html_styles.asp
The Style property of HTML