css中a href格式元素如何写
在CSS中,a href格式元素的写法如下:
css
a {
/* 链接默认蓝色 */
color: blue;
/* 链接访问过后变为紫色 */
color: purple;
}
a:visited {
color: purple;
}
/* 鼠标移动到链接上变为红色 */
a:hover {
color: red;
}
/* 选定的链接变为黄色 */
a:active {
color: yellow;
}
/* 鼠标按下未释放时链接变为绿色 */
a:focus {
color: green;
}
/* 设置下划线 */
a {
text-decoration: underline;
}
/* 取消下划线 */
a {
text-decoration: none;
}
/* 鼠标移动到链接上出现下划线 */
a:hover {
text-decoration: underline;
}
css中a href格式元素的写法:
1.新建一个html文件,命名为test.html,用于讲解css如何给指定的a标签定义c
2.在test.html文件内,创建多个a标签,用于测试。
3.在test.html文件内,设置指定的a标签的id为mytarget。
4.在css标签内,通过id设置a标签的样式。
还没有评论,来说两句吧...