cuốn sách gpt4 ai đã làm

html - 粘性下拉菜单。 (溢出)

In lại Tác giả: Walker 123 更新时间:2023-11-28 19:21:41 26 4
mua khóa gpt4 Nike

我想要一个包括下拉菜单的粘性导航栏。但是,当我将鼠标悬停在它上面时,下拉菜单没有显示。

如果我删除 overflow: hidden;在无序列表中,当我向下滚动时,导航栏设法保持在顶部,但是导航栏是不可见的,只有当我将鼠标悬停在它上面时才会显示(不包括主页按钮)。如果我只删除位置:粘性;它也有效,但我希望它具有粘性。

ul {
kiểu danh sách: không có;
lề: 0;
phần đệm: 0;
background-color: grey;
position:sticky;
position: -webkit-sticky; /* Safari */
tràn: ẩn;
trên cùng: 0;
cỡ chữ: 20px;
chiều rộng: 100%;
}
li {
nổi: trái;
}
li a, .dropbtn {
hiển thị: khối nội tuyến;
màu sắc: trắng;
căn chỉnh văn bản: giữa;
padding: 14px 20px;
trang trí văn bản: không có;
}
li a:hover, .dropdown:hover .dropbtn {
background-color: darkgrey;
}
li.dropdown {
hiển thị: khối nội tuyến;
}
.active {
màu nền: xanh nhạt;
}
.dropdown-nội dung {
hiển thị: không có;
vị trí: tuyệt đối;
background-color: #f9f9f9;
min-width: 160px;
bóng hộp: 0px 8px 16px 0px rgba(0,0,0,0.2);
chỉ số z: 1;
}
.dropdown-nội dung a {
màu sắc: đen;
phần đệm: 12px 16px;
trang trí văn bản: không có;
hiển thị: khối;
căn chỉnh văn bản: trái;
}
.dropdown-content a:hover {
màu nền: #f1f1f1;
}
.dropdown:hover .dropdown-content {
hiển thị: khối;
}

我希望导航栏是粘性的并且能够下拉子导航,但无论哪种方式解决问题,都会出现新问题。

câu trả lời hay nhất

Sẽ hiển thị: khối nội tuyến; Thêm vào của bạn ul 样式中,并从中删除 overflow:hidden。这将允许子菜单显示在 ul 之外。

请参阅下面的代码段:

ul {
kiểu danh sách: không có;
lề: 0;
phần đệm: 0;
background-color: grey;
position:sticky;
position: -webkit-sticky; /* Safari */
/*overflow: hidden;*/
trên cùng: 0;
cỡ chữ: 20px;
chiều rộng: 100%;
hiển thị: khối nội tuyến;
}
li {
nổi: trái;
}
li a, .dropbtn {
hiển thị: khối nội tuyến;
màu sắc: trắng;
căn chỉnh văn bản: giữa;
padding: 14px 20px;
trang trí văn bản: không có;
}
li a:hover, .dropdown:hover .dropbtn {
background-color: darkgrey;
}
li.dropdown {
hiển thị: khối nội tuyến;
}
.active {
màu nền: xanh nhạt;
}
.dropdown-nội dung {
hiển thị: không có;
vị trí: tuyệt đối;
background-color: #f9f9f9;
min-width: 160px;
bóng hộp: 0px 8px 16px 0px rgba(0,0,0,0.2);
chỉ số z: 1;
}
.dropdown-nội dung a {
màu sắc: đen;
phần đệm: 12px 16px;
trang trí văn bản: không có;
hiển thị: khối;
căn chỉnh văn bản: trái;
}
.dropdown-content a:hover {
màu nền: #f1f1f1;
}
.dropdown:hover .dropdown-content {
hiển thị: khối;
}



Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.


Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

关于html - 粘性下拉菜单。 (溢出),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57189268/

26 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress