HTML style
HTML style
First give an example:
改变颜色
字体颜色变红色
字体颜色变绿色
字体高度变为30px
HTML style attribute
The role of the style attribute:
Provides a common way to change the style of all HTML elements.
Styles were introduced in HTML 4 and are the new preferred way to change the style of HTML elements. HTML styles allow you to add styles directly to HTML elements using the style attribute, or indirectly by defining them in a separate style sheet (CSS file).
You can learn all about styles and CSS in our CSS tutorials.
In our HTML tutorial, we will teach you about HTML styles using the style attribute.
How to use CSS
CSS was started in HTML 4 to better render HTML elements The introduced .
CSS can be added to HTML in the following ways:
Inline styles - using the "style" attribute in HTML elements
Internal style sheets-in The
area of an HTML document uses theExternal style sheet
When styles need to be applied to many pages, external style sheets will be the ideal choice. Using external style sheets, you can change the look of your entire site by changing one file.