HTML Basics Learning: Tag properties and elements

Source: Internet
Author: User
Tags html tags
HTML Basics

Although HTML is based on plain text, we still need something more to make a plain text file a legitimate HTML file.

  Label

The basic composition of HTML consists of tags, which surround the content and give some meaning to the content.

Follow the instructions below to improve your files:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
		
		<body>
		这是我的第一个网页
		</body>
		 

Save the file, return to the browser interface and select Refresh (this will reload the page).

There is no change in the appearance of the Web page, the purpose of HTML is to express content, not expression, this example now has defined the page a certain basic elements.

The first line is <! DOCTYPE.. The beginning is to let the browser know what you are going to do. You may not know what you're doing, but it's important to accept it. If you do not, the browser will use the "quirks" (strange) mode to represent your Web page. Don't worry now, of course, if you need to learn or learn from the HTML Advanced learning "document Type". For now, just remember to put this line at the top of the file.

The,

  Closed label 

  </body>and close their respective labels. All HTML tags are closed. Although older versions of HTML allow some labels to not be closed, the latest standard requires that all tags be closed. In any case, closing the label is a good habit.

Not all tags are closed like this , and some labels don't have to be wrapped around the content, they're closed from the outside. For example, the label of a break is like this: <br /> . We still have an example of this. All you need to keep in mind is that all tags must be closed, and most of the content is between tags, and their format is this: start tag-content-close tag.

Property

Tags can have attributes that contain additional information. Properties typically appear in open labels, and their values are always in quotation marks. It's like this: <tag attribute="value"> margarine </tag> . We'll talk about the tag with attributes.

Elements

In addition to marking the beginning and end of the element, the label does not want to do anything more. element is the bits that build the Web page. You might say, for example, that <body> the </body> principal element is between and, like, <title> and </title> is the label, and the <title>Rumple Stiltskin</title> header element.



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.