HTML Basics Tutorial: Learning to master HTML elements

Source: Internet
Author: User
Tags define end html tags lowercase
HTML Basics | Basics Tutorial

An HTML document is a text file composed of HTML elements.

HTML elements are defined by using HTML tags.

HTML tags
  • HTML tags are used to mark HTML elements .
  • HTML tags are surrounded by < and > symbols .
  • These enclosing symbols are called.
  • HTML tags appear in pairs . such as <b> and </b>.
  • The text between the start and end labels is the content of the element.
  • HTML tags are not sensitive to case insensitive,<b> and <B> the same effect.

HTML element

Remember the example in the previous section:

<b>此文本是粗体的。</b> </body>

This is an HTML element:

<b> this text is bold. </b>

This HTML element starts with the start tag <b> .

The content of this element is: "This text is bold." ”。

This HTML element is terminated by the ending tag </b> end.

<b> the function of a label is to define an HTML element that is displayed as bold.

This is also an HTML document:

<body><p> This is my first page. </p><b> this text is bold. </b></body>

This HTML element starts at the <body> tag and ends with the </body> tag.

The function of <body> label is to define HTML elements that contain the body in an HTML file.

Why do we use lowercase labels?

We just talked about: HTML tags are not sensitive to case:<b> and the role of <B> is the same. When you surf the Web, you'll find that most tutorials use uppercase HTML tags in their example. And we always use lowercase. What is the reason?

If you want to prepare for the next generation of HTML, you should use lowercase tags. The standard of the World Wide Web Consortium is that it is recommended to use lowercase labels in html 4, whereas in XHTML (next-generation HTML) you must use lowercase tags.

Label Properties

Labels can have attributes. property to provide additional information to the HTML elements in your page.

The,<body> label is used to define the body element of the page as described above. By adding a bgcolor property, you can tell the browser to display the background color of the page as red, like this: <body bgcolor= "Red" >.

<table> to define an HTML table. By adding a border property, you can tell the browser to display a table without a border: <table border= "0" >.

A property consists of a property name and a value, like this: Name= "value".

Property should be added to the start tag of the HTML element.

Single or double quotes?

Attribute values should be placed between quotation marks. Usually you should use double quotes, but using single quotes is fine.

However, in 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.