当你写的超链接较多时,可以右键单击格式化,就会变得好看很多
设置一个网页的背景,方便我们查看
body{
background-color:#bfa;
}
设置菜单外部容器
.left-nav{
设置宽度
width:190px;
设置高度
height:450px;
设置padding
padding:10px 0;
设置一个背景颜色
background-color:#fff;
margin:50px auto;
}
设置菜单内部的item
.left-nav .item{
height:25px;
要让一个文字在父元素中垂直居中
line-height:25px;
设置item的右内边距,将文字向内移动
padding-left:18px;
}
为item设置一个鼠标移入的状态
.item:hover{
background-color:#d9d9d9;
}
设置超链接的样式
.item a{
设置字体大小
font-size: 14px;
设置字体颜色
color:#333;
去除下划线
text-decoration:none;
}
【设置超链接的hover的样式】
.item a:hover{
color: #c81623;
}
</style>
……