Common HTML tags and introduction (a)

A, HTML head structure

<!DOCTYPE html>

This statement declares the document type for the HTML5 file, but must be placed on the first line of the document essential

Head tag 1. []

head tag definition document for the head, which is a container for all the head elements
many of which are available in the head tag label, such as:. meta title style link will next be introduced one by one

[2] meta tags
用法1:<meta charset="UTF-8">

This sentence defines the character encoding format documents, where charset is a property meta tag, used to set and character encoding format, UTF-8 to Unicode, compatible with the basic language of each country

用法2:<meta name="属性值" content="属性的详细内容"> 
       <meta http-equiv="refresh" content="2" URL=网站">

name, http-equiv is also an attribute meta tags, then introduce a few common keywords:
1.keywords (name) website keywords (for search keys, and you can enter multiple keywords)
2.description (name) a description of the site
3.refresh (http-equiv) represents the periodic refresh the page for a few seconds after the content refresh, URL to jump to refresh the page

3. [title] tag

用法:<title>我的第一个html页面</title>

The title is used to set the page, the name on the tab

Category type two .HTML label

Single and double label [label]

In html tags can be divided into single and dual label tag , through the study, we find that the head, body and other tags are paired, shaped like <head></head> ,<body></body>, similar to these tags called ditags , but there are still some tags the shape <meta><br><hr>of these tags is called a single label .

[Inline label and the block level tag]
1. [label] Inline

Also called inline tags within tag line, inline label (the row labels) has the following characteristics:
1. Do not set the width and height of the text (content wide, there are more wide label display).
2. The same label attribute peer arrangement, the code is interpreted as a line feed space.

[Common] inline tag

<a>  <span>  <img> <b>  <i>  <br>  <input>  <u>

[2] block-level tag

Block-level tag has the following characteristics:
1. always start on a new line;
2. the height, the line height and the top and bottom margins can be controlled;
3. default width is 100% of its container unless a set width

[Common] block-level tag

<div>  <dl>  <form>  <h1>-<h6>  <p>  <table>  <ul>  <ol>  <li> 

Three, HTML tags common usage and introduction

[H tags (title tag)]

Header for indicating, from h1 to h6 successively smaller taper

<!--<h>标题内容</h>-->
      <h1>菠萝蜜</h1
      <h2>菠萝蜜</h2>
      <h3>菠萝蜜</h3>
      <h4>菠萝蜜</h4>
      <h5>菠萝蜜</h5>
      <h6>菠萝蜜</h6>

[Img] tag

For introducing image, the src for the image address, Alt require a prompt information if the picture does not exist, title mouse pointer points on the displayed image when the information.

<img src="图片地址" alt="如果图片不存在,提示信息" title="鼠标指在图片上的提示">

[A] label

a label is used to set the text pictures, hyperlinks
href URL as a hyperlink links, target of _ Self -oriented page jumps, _blank for the new page jump.

<a href="http://www.baidu.com" target="_self">百度</a>
<a href="http://www.baidu.com" target="_blank">百度</a>

[Div tag]

div tag although there is no property, but very important, because it's like a clean piece of paper, post-it can make better use css styles to edit its contents. (Block-level tab)

<div id="" style="" class="">今天天气真不好</div>

[Span tag]

span inline tag (the tag line), which acts like a div tag

<span id="" style="" class="">今天天气真不好</span>

[List] tag
[unordered list]

Generate an unordered list, which type flag before the list can be set up

<ul type="square">
    <li>无序1</li>
    <li>无序2</li>
    <li>无序3</li>
</ul>

[] Ordered list

Generates an ordered list, which can set the number of type styles

<ol type="A">
    <li>有序1</li>
    <li>有序2</li>
    <li>有序3</li>
</ol>

[Label] table

tag table is a table, as follows:

<table border=1px cellpadding="10">
    <thead>
    <tr>
        <th>姓名</th>
        <th>年龄</th>
        <th>爱好</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>小强</td>
        <td>9000</td>
        <td rowspan="2">戴帽子</td>
    </tr>

    <tr>
        <td>小强</td>
        <td>900110</td>
        <td rowspan="2">戴帽子</td>
    </tr>
    </tbody>
</table>

Wherein the border is a border width setting, cellpadding internal width of the table, rowspan to span a plurality of rows.

[Other] label

bold italic b i s u underline text on a line across the p paragraph tag br wrap hr horizontal (line separator)

<b>你今天真好看</b>
<i>今天天气很差</i>
<u>我不想学习</u>
<s>菠萝蜜</s>
<p>不知道说什么</p>
<hr>
<br>

Other special symbol []

&lt 小于
&gt 大于
&copy 版权
&reg 注册商标
&nbsp 空格

NOTE: Label nested rule
1. inline tag can not nest block-level label.
2.p block-level tag label can not be nested.

Guess you like

Origin blog.csdn.net/w819104246/article/details/89283244
Recommended