代码 手机导航效果

2024-11-19 07:53:16 +0800 CST views 683
<!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

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

推荐文章

使用 Vue3 和 Axios 实现 CRUD 操作
2024-11-19 01:57:50 +0800 CST
API 管理系统售卖系统
2024-11-19 08:54:18 +0800 CST
markdown语法
2024-11-18 18:38:43 +0800 CST
CSS 实现金额数字滚动效果
2024-11-19 09:17:15 +0800 CST
12个非常有用的JavaScript技巧
2024-11-19 05:36:14 +0800 CST
html5在客户端存储数据
2024-11-17 05:02:17 +0800 CST
filecmp,一个Python中非常有用的库
2024-11-19 03:23:11 +0800 CST
html一些比较人使用的技巧和代码
2024-11-17 05:05:01 +0800 CST
Vue中如何使用API发送异步请求?
2024-11-19 10:04:27 +0800 CST
# 解决 MySQL 经常断开重连的问题
2024-11-19 04:50:20 +0800 CST
JavaScript 实现访问本地文件夹
2024-11-18 23:12:47 +0800 CST
介绍Vue3的静态提升是什么?
2024-11-18 10:25:10 +0800 CST
Vue3 组件间通信的多种方式
2024-11-19 02:57:47 +0800 CST
开源AI反混淆JS代码:HumanifyJS
2024-11-19 02:30:40 +0800 CST
Vue3中如何处理路由和导航?
2024-11-18 16:56:14 +0800 CST
Golang 中你应该知道的 Range 知识
2024-11-19 04:01:21 +0800 CST
服务器购买推荐
2024-11-18 23:48:02 +0800 CST
ElasticSearch集群搭建指南
2024-11-19 02:31:21 +0800 CST
跟着 IP 地址,我能找到你家不?
2024-11-18 12:12:54 +0800 CST
JavaScript 流程控制
2024-11-19 05:14:38 +0800 CST
15 个你应该了解的有用 CSS 属性
2024-11-18 15:24:50 +0800 CST
程序员茄子在线接单