【CSS】带箭头的二级菜单页面
2022/4/20 23:17:56
本文主要是介绍【CSS】带箭头的二级菜单页面,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> .box { width: 600px; height: 40px; line-height: 50px; background: #ffa4b2; text-align: center; color: white; font-size: 20px; } span { width: 0; height: 0; /*background: white;*/ border: 5px solid transparent; border-top: 5px solid #ffffff; display: inline-block; position: relative; top: 2.5px; left: 8px; } .item ul { list-style: none; padding: 10px; } .box:hover span { border: 5px solid transparent; border-bottom: 5px solid #ffffff; top: -2.5px; } .box .item { float: left; width: 148px; color: #f0f0f0; line-height: 40px; text-align: center; } .item:hover { background: lightblue; } li{ } /* > 子代选择器*/ .item > ul { display: none; background: lightblue; color: white; } .item:hover ul { display: block; } .item li:hover { color: blue; } </style> </head> <body> <div class="box"> <div class="item">导航1<span></span> <ul> <li>Java教程</li> <li>Python教程</li> <li>HTML教程</li> </ul> </div> <div class="item">导航2<span></span> <ul> <li>Java教程</li> <li>Python教程</li> <li>HTML教程</li> </ul> </div> <div class="item">导航3<span></span> <ul> <li>Java教程</li> <li>Python教程</li> <li>HTML教程</li> </ul> </div> <div class="item">导航4<span></span> <ul> <li>Java教程</li> <li>Python教程</li> <li>HTML教程</li> </ul> </div> </div> </body> </html>
这篇关于【CSS】带箭头的二级菜单页面的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-10-25如何用 Jest 测试 CSS Font Loading API(介绍)
- 2024-10-2510 个每个 UI 开发人员都应该知道的 CSS 代码段
- 2024-10-22怎么检测是否已经安装了scss(Sass)-icode9专业技术文章分享
- 2024-10-22TailwindCSS开发入门指南
- 2024-10-22TailwindCSS项目实战:从入门到简单应用
- 2024-10-20TailwindCSS教程:零基础快速入门
- 2024-10-20TailwindCss教程:从零开始的实用指南
- 2024-10-18TailwindCSS入门:快速上手指南
- 2024-10-18Tailwind.css项目实战:新手入门教程
- 2024-10-17Tailwind.css学习:从入门到初步掌握