<!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”
內部樣式表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>