這周學習到了一個選項卡的實現(xiàn),但是涉及到js來完善整個功能,所以今天不再加以敘述。主要從以下兩點講解:定位和漸變線
定位:position:fixed/relative/absolute; 分別是固定相對和絕對,前面筆記已講述。
溢出省略號(主要以下三句連用):
overflow:hidden;
text-overflow:eclipse;
white-space:nowarp;
漸變線
::before /::after
{
content:"";}
創(chuàng)新互聯(lián)主營麻城網(wǎng)站建設的網(wǎng)絡公司,主營網(wǎng)站建設方案,成都App定制開發(fā),麻城h5微信小程序搭建,麻城網(wǎng)站營銷推廣歡迎麻城等地區(qū)企業(yè)咨詢
linear-gradient(270deg,red,yellow,green,pink) 線性漸變
以下是我自己寫的一個關于該知識點的一個代碼,僅供參考
html代碼如下
右邊定位
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="../css/comment.css"/>
<link rel="stylesheet" href="../css/index.css"/>
<link rel="stylesheet" href="../css/font/iconfont.css"/>
</head>
<body>
<div class="right-fixed">
<ul>
<li><a href="">京東秒殺</a></li>
<li><a href=""><img src="../iamge/11.png" alt=""/><img src="../iamge/r.png" alt=""/></a></li>
<li><a href="">特色優(yōu)選</a></li>
<li><a href="">頻道廣場</a></li>
<li><a href="" class="active">為你推薦</a></li>
<li><a href=""><span class="iconfont icon-kefu"></span>客服</a></li>
<li><a href=""><span class="iconfont icon-kefu1"></span>反饋</a></li>
<li><a href=""class="active"><span class="iconfont icon-xiangshang"></span>頂部</a></li>
</ul>
</div>
</body>
</html>
css 如下:/右邊定位/
.right-fixed{
width: 60px;
height: 464px;
background:white;
position: fixed;
top:30%;
right:80px;
z-index: 1;
overflow: hidden;
}
.right-fixed ul li{
width:60px ;
height: 58px;
position: relative;
padding:10px 15px;
}
.right-fixed ul li a{
font-size:14px;
color: #333;
line-height: 19px;
}
.right-fixed ul li:hover{
background:#c81623 ;
cursor: pointer;
}
.right-fixed ul li:hover a{
color: white!important;
}
.right-fixed ul li img{
position: absolute;
top:0px;
left: 0;
width:60px;
height:58px ;
}
.right-fixed ul li img:last-of-type{
display: none;
}
.right-fixed ul li:hover img:last-of-type{
display: block;
}
.right-fixed ul li span{
text-align: center;
display: inline-block;
width:30px;
height: 20px;
}
.right-fixed ul li a.active{
color:#c81623 ;
}
.right-fixed ul li::after{
content: "";
position: absolute;
top:58px;
left: 5px;
right:5px;
height: 1px;
width: 50px;
background: linear-gradient(270deg,#fff,#eee,#fff);
}
涉及圖片和效果圖片如下
網(wǎng)站名稱:web前端開發(fā)的定位和漸變線知識點的應用
標題URL:http://www.ekvhdxd.cn/article0/jsjcoo.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供服務器托管、面包屑導航、移動網(wǎng)站建設、定制開發(fā)、靜態(tài)網(wǎng)站、品牌網(wǎng)站制作
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)