Home > Web Front-end > H5 Tutorial > H5 learning journey-H5 style (5)

H5 learning journey-H5 style (5)

黄舟
Release: 2017-02-17 14:21:44
Original
1279 people have browsed it

How to introduce styles

External style sheet

link rel = “stylesheet” type = “text/css” href = “mystyle.css”

Internal style sheet

style type = “text/css” body { background-color:red} p{margin-left:20px} style

Inline style sheet

P style = “color:red”

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 type="text/css">
        p{            color: blue;        }
    </style></head><body>
    <h1>标题1</h1>
    <p>欢迎刘朋</p>
    <a href="http://www.baidu.com" style="color: chartreuse;">点击我跳转</a></body></html>
Copy after login
Copy after login

Rendering

H5 learning journey-H5 style (5)

How to introduce styles

External style sheet

link rel = “stylesheet” type = “text/css” href = “mystyle.css”

Internal style sheet

style type = “text/css” body { background-color:red} p{margin-left:20px} style

Inline style sheet

P style = “color :red”

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 type="text/css">
        p{            color: blue;        }
    </style></head><body>
    <h1>标题1</h1>
    <p>欢迎刘朋</p>
    <a href="http://www.baidu.com" style="color: chartreuse;">点击我跳转</a></body></html>
Copy after login
Copy after login

Rendering

H5 learning journey-H5 style (5)

## The above is the content of H5 learning journey-H5 style (5) , 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