当我们使用a标签时总会被a标签的默认样式带来困扰,今天给大家分享a标签默认样式如何修改
一、HTML代码
<a>这是一个链接</a>
二、CSS样式
a {
color:#666666;//字体颜色
text-decoration: none;//去除a标签下划线
outline: none;//去掉a标签默认轮廓
}
visited:访问 顾名思义 a:visited就是a标签访问过后的样式
a:visited {
text-decoration: none;
outline: none;
color:red;
}
a:link 是a标签带有链接时的样式
a:link {
text-decoration: none;
outline: none;
}
a:hover 是鼠标经过和悬停在a标签上时的样式
a:hover{
color:#6ea2d7;
}
想让鼠标位移到a标签上时光标变成小手就使用 cursor: pointer;
a{
cursor: pointer;
}