HTML Basics Tutorial (4)--html Properties

Source: Internet
Author: User

Property provides additional information for HTML elements.

Properties of HTML Tags

HTML tags have properties. Property provides additional information for HTML elements.

Properties are always in the form of name/value pairs, such as: Name= "value"

Attributes are always specified in the start tag of an HTML element.

attribute Example 1:

<H1 align= "Center" > has additional information about alignment.

Tiy: Centering the headings

<!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd "><HTML><Body><H1Align= "Center">This is Heading 1</H1><P>The above headings are centered on the page. The above headings are centered on the page. The above headings are centered on the page.</P></Body></HTML>

attribute Example 2:

<body> defines the body of the HTML document.

<body bgcolor= "Yellow" > has additional information about the background color.

Tiy: Background color

<HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=gb2312" /><Metahttp-equiv= "Content-language"content= "ZH-CN" /></Head><Bodybgcolor= "Yellow"><H2>See: Change the color of the background.</H2></Body></HTML>

attribute Example 3:

<table> define HTML tables. (You will learn more about HTML tables in a later section.)

<table border= "1" > has additional information about the table border.

Use lowercase attributes

Property and property values are not case sensitive . However, the World Wide Web Consortium recommends lowercase attribute/attribute values in its HTML 4 recommendation standard, while XHTML requires lowercase attribute/attribute values.

Always quote attribute values

Property values should always be included in quotation marks. Double quotes are the most common, but there is no problem with single quotes.

In some individual cases, such as the attribute value itself contains double quotes, you must use single quotes, for example:

Name= ' John ' shotgun ' Nelson '

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.