CSS初学

CSS作用是美化html网页。
内联:body 标签里。
内嵌:head标签里,可以多次重复使用
.p{}:引用时,class引用。
#p{}:引用时,id引用
超链接的style
a:link 超链接被点前的状态
a:visited 超链接被点后的状态
a:hover 悬停在超链接的状态
a:active 点击超链接是
定义这些状态的顺序:l v h a

<title>CSS练习</title>
<style type="text/css">                               //内嵌
p{
background-color:#090;
font-size:16px
}
</style>

<link href="../CSS.css" rel="stylesheet" type="text/css" />            //css的引用

</head>
<body>

<div style="background:#3F9; font-size:36px">div标签</div>                                   //内·联

<p >春天来了,我很开心</p>

<div class="b">夏天</div>

<span id="c">秋天</span>

<a href="http://www.baidu.com">百度</a>

</body>
</html>

CSS

@charset "utf-8";
/* CSS Document */

*                 //所有都使用
{ margin:9px;
padding:0px;}
.b
{
background-color:#60C;
font-weight:600}
#c
{
background-color:#FF6}

超链接style:
a:link
{
font-family:Verdana, Geneva, sans-serif;
color:#000}
a:visited
{
color:#F03}
a:hover
{
color:#30C}
a:active
{
color:#6F6}

原文地址:https://www.cnblogs.com/wanlibingfeng/p/5308848.html