首頁  >  文章  >  web前端  >  H5學習之旅-H5的樣式(5)

H5學習之旅-H5的樣式(5)

黄舟
黄舟原創
2017-02-17 14:21:441183瀏覽

樣式的引入方式

外部樣式表

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

內部樣式表

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

內聯樣式表

P style = “color:red”

程式碼實例

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

引入方式

外部樣式表

link rel = “stylesheet” type = “text/css” href = “mystyle.css”H5學習之旅-H5的樣式(5)

內部樣式表

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

內聯樣式表

P style = “color:red”

程式碼實例

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

效果圖

程式碼實例

rrreee

效果圖

樣式(5)的內容,更多相關內容請關注PHP中文網(www.php.cn)!

H5學習之旅-H5的樣式(5)

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn