Home  >  Article  >  Web Front-end  >  H5 learning journey-the use of H5 block tags (9)

H5 learning journey-the use of H5 block tags (9)

黄舟
黄舟Original
2017-02-17 14:34:271481browse

Basic syntax of block elements

1. Html block elements. Block elements usually start with a new line at the beginning, such as h1, p, ul

2 .Inline elements usually do not start with a new line, such as a, b, img

3.html p element, p is also called a block element, which is mainly used as a container for combining html elements

4.html span element, the span element is an inline element and can be used as a container for text

! ! ! ! ! ! Code example

<!DOCTYPE html><html lang="en"><head>
    <meta charset="UTF-8">
    <title>H5块元素</title>
    <link rel="stylesheet" type="text/css" href="myStyle.css">
    <style>
        span{            color:chartreuse;        }
    </style></head><body>
    <p>这是一个段落</p>
    <h1>这是一个标题</h1>
    <b>这是一个加重</b>
    <a>这是一个超链接</a>
    <p id="pId">
        <p>
            这是一个段落        </p>
        <a>这是一个超链接</a>
    </p>
    <p>
        <P><span>这是一个span测试,</span>测试效果</P>
    </p></body></html>

css code

#pId p{    color:red;}

pId is the id of di, and the following p is the specified P tag

Rendering

H5 learning journey-the use of H5 block tags (9)

Basic syntax of block elements

1. Html block elements. Block elements usually start with a new line at the beginning, such as h1, p, ul

2. Inline elements usually do not start with a new line, such as a, b, img

3.html p element, p is also called a block element, which is mainly used as a container for combining html elements

4.html span element, span element is an inline element and can be used as a container for text

! ! ! ! ! ! Code example

<!DOCTYPE html><html lang="en"><head>
    <meta charset="UTF-8">
    <title>H5块元素</title>
    <link rel="stylesheet" type="text/css" href="myStyle.css">
    <style>
        span{            color:chartreuse;        }
    </style></head><body>
    <p>这是一个段落</p>
    <h1>这是一个标题</h1>
    <b>这是一个加重</b>
    <a>这是一个超链接</a>
    <p id="pId">
        <p>
            这是一个段落        </p>
        <a>这是一个超链接</a>
    </p>
    <p>
        <P><span>这是一个span测试,</span>测试效果</P>
    </p></body></html>

css code

#pId p{    color:red;}

pId is the id of di, and the following p is the specified P tag

Rendering

H5 learning journey-the use of H5 block tags (9)

The above is the content of the H5 learning journey - the use of H5 block tags (9). For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn