html右边侧边栏固定悬浮(PHP渲染)

9 篇文章 0 订阅

CSS:

.toolbars ul li{
            list-style: none;
        }
        .toolbars ul a{
            text-decoration: none;
            color: #666;
        }
        .toolbars ul a:hover{
            color:#969696!important;
        }
        /*京东右侧固定图标菜单栏*/
        .toolbars{
            position: fixed;
            top: 0;
            right: 0;
            height: 100%;
            width: 6px;
            background-color: #7a6e6e;
        }
        .toolbars ul{
            position:absolute;
            top: 40%;
            right: 0;
            transform: translate(0,-40%);
            z-index: 3;
        }
        .toolbars ul li{
            width: 34px;
            /* height: 35px; */
            margin-bottom: 30px;
            font-size:15px; 
            background-color: #7A6E6E;
            vertical-align:middle;
            text-align: center;
            position: relative;
        }
        .toolbars ul .jdvip .toolbars-ico{
            display: block;
            width: 34px;
            /* height: 35px; */
            color: #fff; 
            padding-top: 10px;
            padding-bottom: 10px;  
            background-color:red;
        }
        .toolbars ul .cart .toolbars-ico{
            display: block;
            width: 34px;
            /* height: 35px; */
            color: #fff;
            padding-top: 10px;
            padding-bottom: 10px;  
            background-color:blue;
        } 

HTML:
 

<div class="toolbars">
	    	<ul>
	    		<li class="jdvip" style="display:{$kdaddress ? 'block': 'none'}">
	    			<i></i>
	    			<a class="toolbars-ico" href="{$kdaddress}">查<br>看<br>快<br>递</a> 
	    		</li>
	    		<li class="cart" style="display:{$dsaddress ? 'block': 'none'}">
	    			<a class="toolbars-ico" href="{$dsaddress}">180<br>天<br>读<br>书<br>计<br>划</a> 
	    		</li>
                </ul>     	
	    </div> 

注:这里用了php渲染,单独样式只需要将html中的{}全部删掉就好了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值