Using the navigation bar and the side of the fixed pseudo-classes / pseudo-element

Fixed side navigation bar

Here Insert Picture Description

<div id="tool">
	<span></span>
	<div class="btn">
		<a href="" class="c4 active">爱逛 好货</a>
		<a href="" class="c5">好店 直播</a>
		<a href="" class="c6">品质 特色</a>
		<a href="" class="c7">实惠 热卖</a>
		<a href="" class="c4">猜你 喜欢</a>
		<a href="" class="item6">反馈</a>
		<a href="" class="">暴恐 举报</a>
	</div>


#tool {
	width: 50px;
	height: 350px;
	position: fixed;
	right: 3%;
	top: 100px;
	
}
#tool span{
	display: block;
	background-image: url(images/logo.png);
	width: 24px;
	height: 24px;
	background-repeat: no-repeat;
	position: absolute;
	top:-24px;
	left: 13px;


}

#tool div{
	height: 350px;
	border-radius: 8px;
	overflow: hidden;
}

#tool a{
	display: block;
	width: 50px;
	height: 50px;
	text-align: center;
	background: #fff;
	word-break: keep-all;/*空格为限,强制换行*/
	padding-top: 6px;
	box-sizing: border-box;
	position: relative;
}

#tool a:after{/*一个冒号为伪类,两个冒号为伪元素,IE8没有双冒号语法
*/
	content: '';
	border-bottom: 1px solid #efefef;
	width: 34px;
	position: absolute;
	left: 8px;
	bottom: 0;
}

.item6{
	line-height: 38px;
}

#tool a:hover ,#tool a.active{
	background: linear-gradient(135deg,#ff9000,#ff5000);/*第一个参数是角度*/
	color: #fff;
	font-weight: bold;

}
#tool a:hover:after,#tool a.active:after{
	border: none;
}


Published 116 original articles · won praise 4 · Views 1783

Guess you like

Origin blog.csdn.net/qq_43618136/article/details/104226374