代码 手机导航效果

2024-11-19 07:53:16 +0800 CST views 1478
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0 ">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>drop-down</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        body{
            background: #66CCCC;
            padding: 40px 0;
            text-align: center;
        }
        .ribbon{
            display: inline-block;
        }
        .ribbon::before{
            margin-top: 8px;
            content: "";
            border: 24px solid #333;
            border-left-color: transparent;
            float: left;
        }
        .ribbon::after{
            margin-top: 8px;
            content: "";
            border: 24px solid #333;
            border-right-color: transparent;
            float: left;
        }
        a{
            float: left;
            height: 56px;
            text-decoration: none;
            overflow: hidden;
        }
        span{
            margin-top: 8px;
            color: #fff;
            line-height:48px;
            padding: 0 16px;
            background: #333;
            display: inline-block;
            position: relative;
            transition: all 0.3s;
        }
        a:hover span{
            margin-top: 0;
            background: #666699;
        }
        span::before{
            content: "";
            position: absolute;
            top: 48px;
            left: 0;
            border-right: 8px solid #666699;
            border-bottom: 8px solid #333;
        }
        span::after{
            content: "";
            position: absolute;
            top:48px;
            right: 0;
            border-left: 8px solid #666699;
            border-bottom: 8px solid #333;
        }
</style>
</head>
<body>
    <div class="ribbon">
        <a href="#"><span>Home</span></a>
        <a href="#"><span>About</span></a>
        <a href="#"><span>Services</span></a>
        <a href="#"><span>Contact</span></a>
    </div>
    <div style="clear:both;"></div>
</body>
</html>

images

复制全文 生成海报 网页开发 前端设计 用户界面

推荐文章

Vue中的异步更新是如何实现的?
2024-11-18 19:24:29 +0800 CST
Vue3结合Driver.js实现新手指引功能
2024-11-19 08:46:50 +0800 CST
JavaScript中的常用浏览器API
2024-11-18 23:23:16 +0800 CST
Vue3中的v-model指令有什么变化?
2024-11-18 20:00:17 +0800 CST
404错误页面的HTML代码
2024-11-19 06:55:51 +0800 CST
Python设计模式之工厂模式详解
2024-11-19 09:36:23 +0800 CST
html文本加载动画
2024-11-19 06:24:21 +0800 CST
js常用通用函数
2024-11-17 05:57:52 +0800 CST
全栈利器 H3 框架来了!
2025-07-07 17:48:01 +0800 CST
Roop是一款免费开源的AI换脸工具
2024-11-19 08:31:01 +0800 CST
PyMySQL - Python中非常有用的库
2024-11-18 14:43:28 +0800 CST
HTML和CSS创建的弹性菜单
2024-11-19 10:09:04 +0800 CST
php 统一接受回调的方案
2024-11-19 03:21:07 +0800 CST
程序员茄子在线接单