The Style property of HTML

Source: Internet
Author: User
Tags deprecated

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 dimensions

The 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 alignment

The 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.