当前位置:网站首页>粘制定位
粘制定位
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时则开启元素的粘制定位
-粘制定位和相对定位的特点基本一致,
不同的是粘制定位可以在元素到达某个位置时将其固定
边栏推荐
- Map interface
- Forward pre check and reverse pre check
- From the perspective of it, the CIO of B2B industry talks about how to change from "cost center" to "growth center"?
- How to get class objects
- 一款能模糊的地方都能模糊的测试工具——Wfuzz
- 字节跳动的 Flink OLAP 作业调度和查询执行优化实践
- Antd's tool function getprefixcls gets the public prefix
- Xianghe meat cake in memory
- Plus版SBOM:流水线物料清单PBOM
- Detail try catch finally
猜你喜欢

Seata 在蚂蚁国际银行业务的落地实践

Is it easy to find a job after programmer training and learning

Laboratory procedures and references of chloramphenicol acetate

Security measures for tcp/ip protocol vulnerabilities

C program debugging and exception handling (try catch)

Dominoes staged: the beginning and end of the three arrow capital crash

18. Text processing tool -grep

Optimization Practice of Flink OLAP job scheduling and query execution based on ByteDance
![[cute new solution] Fibonacci sequence](/img/2d/64cdc8b7625ee7a81275ad25dc2b7a.png)
[cute new solution] Fibonacci sequence

heap
随机推荐
2021-03-15
Multi activity disaster recovery construction after 713 failure of station B | takintalks share
Security measures for tcp/ip protocol vulnerabilities
Seata 在蚂蚁国际银行业务的落地实践
Lambda expression
Will saffron become a safe and effective natural therapy for patients with arthritis?
heap
Xposed+FDex2 app脱壳 (黑猫投诉app脱壳)
Top 10 international NFT exchanges
BSP视频教程第21期:轻松一键实现串口DMA不定长收发,支持裸机和RTOS,含MDK和IAR两种玩法,比STM32CubeMX还方便(2022-07-24)
An overview of kernel compilation system
Detail try catch finally
Map interface
[nuxt 3] (XII) project directory structure 2
Regular expressions remove spaces at both ends
概述有名内部类与匿名内部类
ECCV2022 | RU&谷歌提出用CLIP进行zero-shot目标检测!
银行案例|Zabbix跨版本升级指南,4.2-6.0不香吗?
SparkSubmit.main()方法提交外部参数,远程提交standalone集群任务
ArrayList常用方法总结