一、伪类
CSS控制元素的某种状态---偽类(用于向某些选择器添加特殊的效果)
偽类的语法:元素标签 偽类名称{属性:属性值;}
二、超链接
a:link:未访问的链接
a:hover:鼠标移动到链接上
a:active:鼠标按下链接
a:visited:已访问的链接
如果在点击过后再返回到该页面还有一些效果的话 就按照该顺序给链接添加状态 L V H A
复制代码代码如下:
<style type="text/css">
a:link{text-decoration:none; color:#000;}
a:visited{text-decoration:none; color:#6F0;}
a:hover{text-decoration:underline; color:#00F;}
a:active{text-decoration:overline; color:#F00;}
a.web:visited{text-decoration:none; color:#000;}
</style>
</head>
<body>
<div id="link">
<a href="<a href="http://www.baidu.com">http://www.baidu.com</a>" class="web">网页设计</a> |
<a href="<a href="http://www.baidu.com">http://www.baidu.com</a>">平面设计</a> |
<a href="<a href="http://www.baidu.com">http://www.baidu.com</a>">网站前端</a> |
<a href="<a href="http://www.baidu.com">http://www.baidu.com</a>">动画设计</a> |
<a href="<a href="http://www.baidu.com">http://www.baidu.com</a>">软件开发</a> |
<a href="<a href="http://www.baidu.com">http://www.baidu.com</a>">网页营销</a>
<a href="<a href="http://www.baidu.com">http://www.baidu.com</a>">我会闪</a>
</div>
</body>
三、:focus{属性:属性值}设置对象在成为输入焦点时的样式(IE6/7不支持)
复制代码代码如下:
<style type="text/css">
input{
width:200px;
height:25px;
border:2px solid #FF0;
}
input:focus{
background:#9FF;
}
</style>
</head>
<body>
<label>用户名: <input type="text" name="username"/></label>
<label>密 码: <input type="text" name="pwd"/></label>
</body>
四、练习
1.给链接加上边框
复制代码代码如下:
<style type="text/css">
a{
font-size:36px;
}
a:link{
color:#009;
text-decoration:none;
border-bottom:2px solid #F00;
line-height:150%;
/*line-height:是为了和下划线分开点*/
}
</style>
</head></p>
<p><body>
<a href="#">PHP.COM中文网</a>
</body>
2.在超链接中用背景图象添加记号(给超链接a加上背景图片即可)
复制代码代码如下:
<style type="text/css">
a:link{
color: #f00;
padding-left:13px;
background:url(fasfas.gif) no-repeat left center;
text-decoration:none;
}
a:visited{
color:#900;
padding-left:13px;
background:url(das.gif) no-repeat left center;
text-decoration:none;</p>
<p>}
<!--将visited改为hover可以实现鼠标浮动的效果-->
</style>
</head></p>
<p><body>
<p>PHP100.COM中文网,<a href="<a href="http://www.baidu.com">PHP</a">www.baidu.com">PHP</a</a资源共享站</p>
</body>
7.创建按钮和翻转
复制代码代码如下:
<style type="text/css">
a {
Display: block;
Width: 140px;
Padding: 3px;
height:30ox
Line-height: 30px;
Background-color: #94b8e9;
Border: 1px solid black;
Color: #000;
Text-decoration: none;
Text-align: center;
}
a:hover {
background-color: #369;
color:#fff;
}
</style>
</head>
<body>
<a href="http:\\www.baidu.com">PHP100.COM中文网</a>
</body>
8.纯 css 工具提示
复制代码代码如下:
<style type="text/css">
a.tooltip {
position: relative;
}
a.tooltip span {
display: none;
}
a.tooltip:hover {
font-size: 100%; /* Fixes bug in IE5.x/Win */
}
a.tooltip:hover span {
display:block;
position:absolute;
top:1em;
left:2em;
padding: 0.2em 0.6em;
border:1px solid #996633;
background-color:#FFFF66;
color:# 000;
}
</style>
</head>
<body>
<p><a href="#">PHP.COM<span>PHP官网</span></a></p>
<p>
<a href="<a href="http://www.anfsdfasdybufdsfdasfdd.com/">http://www.anfsdfasdybufdsfdasfdd.com/</a>" class="tooltip">Andy Budd<span> (This website
rocks) </span></a> is a web developer based in Brighton England.
</p>
</body>
css超链接
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
更新日志
- 群星《前途海量 电影原声专辑》[FLAC/分轨][227.78MB]
- 张信哲.1992-知道新曲与精丫巨石】【WAV+CUE】
- 王翠玲.1995-ANGEL【新艺宝】【WAV+CUE】
- 景冈山.1996-我的眼里只有你【大地唱片】【WAV+CUE】
- 群星《八戒 电影原声带》[320K/MP3][188.97MB]
- 群星《我的阿勒泰 影视原声带》[320K/MP3][139.47MB]
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[320K/MP3][148.91MB]
- 刘雅丽.2001-丽花皇后·EMI精选王【EMI百代】【FLAC分轨】
- 齐秦.1994-黄金十年1981-1990CHINA.TOUR.LIVE精丫上华】【WAV+CUE】
- 群星.2008-本色·百代音乐人创作专辑【EMI百代】【WAV+CUE】
- 群星.2001-同步过冬AVCD【环球】【WAV+CUE】
- 群星.2020-同步过冬2020冀待晴空【环球】【WAV+CUE】
- 沈雁.1986-四季(2012梦田复刻版)【白云唱片】【WAV+CUE】
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[FLAC/分轨][257.88MB]
- 《国语老歌 怀旧篇 3CD》[WAV/分轨][1.6GB]