当前位置:网站首页>粘制定位
粘制定位
2022-07-27 12:48:00 【不好意思,此人不存在】
粘制定位
<!DOCTYPE html>
<html lang="ch">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>导航条</title>
<link rel="stylesheet" href="/layout/css/reset.css">
<style> body{
height: 3000px; } /* 设置nav的大小 */ .nav{
width: 1210px; height: 48px; background-color: #E8E7E3; margin: 100px auto; /* 粘制定位 */ position: sticky; top: 0; } /* 设置nav中li */ .nav li{
/* 设置li向左浮动,使菜单横向排列 */ float: left; /* 设置li的高度 */ /* height: 48px; */ /* 将文字在父元素中垂直居中 */ line-height: 48px; } /* 设置a的样式 */ .nav a{
/* 将a转换为块元素 */ display: block; padding: 0 39px; /* 去除下划线 */ text-decoration: none; color: #777777; font-size: 18px; } .nav li:last-child a{
padding: 0 46px 0 45px; } /* 设置鼠标移入效果 */ .nav a:hover{
background-color: #3f3f3f; color: #E8E7E3; } </style>
</head>
<body>
<!-- 创建导航条的结构 -->
<ul class="nav">
<li>
<a href="#">HTML/CSS</a>
</li>
<li>
<a href="#">Brower Side</a>
</li>
<li>
<a href="#">Server Side</a>
</li>
<li>
<a href="#">Programming</a>
</li>
<li>
<a href="#">XML</a>
</li>
<li>
<a href="#">Web Building</a>
</li>
<li>
<a href="#">Reference</a>
</li>
</ul>
</body>
</html>
- 粘制定位
-当元素的position属性设置为sticky时则开启元素的粘制定位
-粘制定位和相对定位的特点基本一致,
不同的是粘制定位可以在元素到达某个位置时将其固定
边栏推荐
- Will saffron become a safe and effective natural therapy for patients with arthritis?
- A survey of video game addictive behavior research
- Gartner 权威预测未来4年网络安全的8大发展趋势
- 592. 分数加减运算 : 表达式计算入门题
- Connotative quotations
- NFT mall /nft blind box / virtual blind box /nft transaction / customizable second opening
- 程序员培训学习后好找工作吗
- 最新版泛域名证书申请
- 详述throw与throws
- CEPH distributed storage performance tuning (6)
猜你喜欢

Self built personalized automatic quotation system to cope with changeable quotation mode

爱可可AI前沿推介(7.27)

Laboratory procedures and references of chloramphenicol acetate

ECCV2022 | RU&谷歌提出用CLIP进行zero-shot目标检测!

Error: the source of the existing CacheManager is: urlconfigurationsource

2022 global Vocational Education Industry Development Report

Error: slf4j: class path contains multiple slf4j bindings

C program debugging and exception handling (try catch)

Mixin\ plug in \scoped style

MySQL extensions
随机推荐
ECCV2022 | RU&谷歌提出用CLIP进行zero-shot目标检测!
开源项目丨Taier1.2版本发布,新增工作流、租户绑定简化等多项功能
事务四大特性(ACID):
延迟队列DelayQueue性能测试
Jesd204b debugging notes (practical version)
Forward pre check and reverse pre check
Xianghe meat cake in memory
Background and framework introduction and basic environment preparation of hucang integrated e-commerce project
GAN:生成对抗网络 Generative Adversarial Networks
Reptile
Specify the add method of HashSet
Open source project - taier1.2 release, new workflow, tenant binding simplification and other functions
Feign的两个调用处理器
爱可可AI前沿推介(7.27)
聊聊feign组件的一个重要类RefectiveFeign
Seata's landing practice in ant International Banking
xshell7可以登录mysql虚拟机不能登陆mysql
文章复现:SRCNN
Time tool class, get the current time, date to string
Minimally invasive brain science broke the listing: the company's market value is HK $14.3 billion, and minimally invasive medical is the major shareholder