<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>混合</title> <!--多个一起使用时,内联方式优先 其他三种方式,同样的属性谁离元素最近(越靠下),最终使用的效果就是谁 不重复的都有效--> <link href="Style.css" type="text/css" rel="stylesheet"> <style> p{ color: green; } </style> </head> <body> <p style="color: red">大王叫我来巡山</p> <p>巡完南山巡北山</p> </body> </html>
css
p{ font-family: "黑体"; font-size: 20; color: blueviolet; text-align: center; /*居中显示*/ } div{ color: blue; text-decoration: underline; /*下划线*/ }