导航(css伪类属性)

165 阅读1分钟

Css 2022年1月6日

css伪类属性 a:link正常状态下样式
a:visted被点击过的超链接样式
a:hove 鼠标经过的样式
a:active激活时的样式,激活样式浏览器被解释成鼠标按下样式
例:a:link{
color:#oo579;,
text-decoration:none;
}
a:visited{
color:#000000;
text-dicoration:none; }
a:hover{
color:#222222;
text-decoration:none
}

减少代码冗余例:
nav>a{
font-sie:20px; margin-right:20px;
margin-left:20px;
}
nav>a:link,nav>a:visited{
color:#0000;
text-decortion:none;
}
nav>a:hover{
color:#;
tetx-decortion:underline;
}

    导航特点:文字颜色变化、背景发生变化、文字背景+颜色发生变化、背景+下划线(下划线,border-bottom)<br>
    dispaly:<br>
    none:隐藏对象 <br>
    block:以块的形式出现(为对象之后添加新行) <br>
    inline:默认值,内联元素(将块级转化为文本级)<br> inline-block:内联块级元素(css2.1新增)