Home > Web Front-end > H5 Tutorial > body text

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

黄舟
Release: 2017-02-17 14:34:27
Original
1557 people have browsed it

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>
Copy after login
Copy after login

css code

#pId p{    color:red;}
Copy after login
Copy after login

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>
Copy after login
Copy after login

css code

#pId p{    color:red;}
Copy after login
Copy after login

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)!


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!