Maison >interface Web >tutoriel HTML >CSS 行内样式 页内样式 外部样式_html/css_WEB-ITnose

CSS 行内样式 页内样式 外部样式_html/css_WEB-ITnose

WBOY
WBOYoriginal
2016-06-24 11:17:251282parcourir

行内标签:

<!DOCTYPE html><html><head lang="en">    <meta charset="UTF-8">    <title></title></head><!--style="background-color: red;"--><body style="background-color: red;"><!--行内样式-->    <div style="font-size: 30px; color: red; background-color: green;">旭宝爱吃鱼</div>    <div style="font-size: 30px; color: red; background-color: green;">旭宝爱吃鱼</div>    <div style="font-size: 30px; color: red; background-color: green;">旭宝爱吃鱼</div>    <div style="font-size: 30px; color: red; background-color: green;">旭宝爱吃鱼</div>    <div style="font-size: 30px; color: red; background-color: green;">旭宝爱吃鱼</div>    <div style="font-size: 30px; color: red; background-color: green;">旭宝爱吃鱼</div>    <div style="font-size: 30px; color: red; background-color: green;">旭宝爱吃鱼</div>    <p style="font-size: 40px; color: yellow;">旭宝爱吃鱼</p>    <div style="font-size: 30px; color: red; background-color: green;">旭宝爱吃鱼</div>    <div style="font-size: 30px; color: red; background-color: green;">旭宝爱吃鱼</div>    <div style="font-size: 30px; color: red; background-color: green;">旭宝爱吃鱼</div>    <div style="font-size: 30px; color: red; background-color: green;">旭宝爱吃鱼</div></body></html>

图片

业内标签:

<!DOCTYPE html><html><head lang="en">    <meta charset="UTF-8">    <title></title>    <!--      css遵循一个规律:      1.就近原则      2.叠加原则    -->    <style>        div{           color: purple;           font-size: 40px;           background-color: yellowgreen;        }        p{            color: deeppink;            font-size: 50px;        }    </style>    <link href="css/index.css" rel="stylesheet"></head><body>   <div style="color: hotpink; background-color: red;">旭宝爱吃鱼</div>   <div>旭宝爱吃鱼</div>   <div>旭宝爱吃鱼</div>   <div>旭宝爱吃鱼</div>   <div>旭宝爱吃鱼</div>   <p>旭宝爱吃鱼</p>   <p>旭宝爱吃鱼</p>   <p>旭宝爱吃鱼</p>   <p>旭宝爱吃鱼</p></body></html>

图片:

外部样式:

div{    color: brown;    font-size: 50px;}p{    background-color: yellow;    color: darkgreen;    font-size: 39px;}

图片:

<!DOCTYPE html><html><head lang="en">    <meta charset="UTF-8">    <title></title>    <link rel="stylesheet" href="css/index.css"></head><body>   <div>旭宝爱吃鱼</div>   <p>旭宝爱吃鱼</p></body></html>

图片:

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn