Basic html knowledge you must master

零下一度
Release: 2017-05-05 13:55:55
Original
2028 people have browsed it


1. Overview of HTML

HTML is the abbreviation of Hyper Text Markup Language, which means " "Hypertext Markup Language" is actually a programming language specially used to write web pages. The basis of most web pages is HTML statements.

1. The basic structure of HTML document


All pages should contain at least these parts. Since the browser is highly fault-tolerant, it can be displayed normally even if it is not included, but it is best to write them completely.

2. How to write an HTML file

HTML file is a file in ASCII format. It can be edited in any editor that can edit ASCII files (if the HTML file contains Chinese characters, it must be edited in an editor that supports Chinese characters).

3. Debugging of HTML files

Open it directly with a browser and check the running results

4. Content of HTML file

◇ The header part is to add some auxiliary or attribute information to the Html page, and the content inside it will be loaded first. The body part is where the page data is actually stored.

◇ Most tags have a start tag and an end tag. Some tags can end within the tag because they have only a single function or there is no content to be modified.

◇ If you want to perform richer operations on the content modified by tags, you use the attributes in the tags. By changing the attribute values, more effect options are added.

◇ Use "=" to connect attributes and attribute values. Attribute values ​​can use double quotes, single quotes, or no quotes. Generally, double quotes are used. Or company regulations writing standards.

5. Tags in HTML files

1) Format: or 2) Operation idea: For operation Data needs to be encapsulated with different tags, and the encapsulated data can be operated through the attributes in the tags.

A label is equivalent to a container. To operate on the data in the container is to continuously change the attribute values ​​of the container.

2. List

A list is a method of arranging information in an organized manner. It displays the content horizontally one by one, intuitively and clearly. And it is also different from tables. Generally, lists are not as complicated as tables.

1. Unordered list

<span style="font-size:14px;"><ul>
  <li>咖啡</li>
  <li>茶</li>
  <li>牛奶</li>
</ul></span>
Copy after login


2. Ordered list

<span style="font-size:14px;"><ol>
  <li>咖啡</li>
  <li>牛奶</li>
  <li>茶</li>
</ol>

<ol start="50">
  <li>咖啡</li>
  <li>牛奶</li>
  <li>茶</li>
</ol></span>
Copy after login


##3. Definition list

Custom lists start with the

tag. Each custom list item begins with
. The definition of each custom list item begins with
.
<span style="font-size:14px;"><dl>
<dt>Coffee</dt>
<dd>Black hot drink</dd>
<dt>Milk</dt>
<dd>White cold drink</dd>
</dl></span>
Copy after login

Result:

  • Coffee

  • Black hot drink

  • Milk

  • ##White cold drink

4. Two complex list tags ul and ol that can have attributes

## 1)