首页 > 其他分享 >css 带箭头下拉框

css 带箭头下拉框

时间:2022-12-08 16:46:34浏览次数:33  
标签:solid 100% transparent 箭头 10px border 下拉框 css

引用这里
http://t.zoukankan.com/yhhBKY-p-12196510.html

<div class="row-1">clip-path:我是row-1</div> <div class="row-2">我是row-2</div> <div class="row-3"> <div>clip-path:我是row-3</div> </div> <div class="row-4">我是row-4</div> <div class="row-5">我是row-5</div>

  .row-1{
            margin: 20px auto;
            width: 200px;
            height: 50px;
            color: #fff;
            line-height: 50px;
            text-align: center;
            background: teal;
            /* 箭头靠右边 */
            clip-path: polygon(0 0, 88% 0, 88% 35%, 95% 50%, 88% 65%, 88% 100%, 0 100%);
                /* 箭头靠下边 */
            /* clip-path: polygon(0 0, 100% 0, 100% 85%,35% 85%, 30% 100%,25% 85%,0% 85%); */
            /* 箭头靠左边 */
            /* clip-path: polygon(5% 0, 100% 0, 100% 100%,5% 100%, 5% 65%,0 50%,5% 35%); */
            /* 箭头靠下边 */
            /* clip-path: polygon(0 15%, 25% 15%, 30% 0,35% 15%, 100% 15%,100% 100%,0% 100%); */
            border: 1px solid teal;
        }
        .row-2{
            margin: 20px auto;
            position: relative;
            width: 200px;
            height: 50px;
            color: #fff;
            line-height: 50px;
            text-align: center;
            border: 1px solid teal;
            border-radius: 5px;
            background: teal;
        }
        .row-2::after{
            content: '';
            position: absolute;
            width: 0;
            height: 0;
            /* 箭头靠右边 */
            top: 13px;
            right: -10px;
            border-top: 10px solid transparent;
            border-bottom: 10px solid transparent;
            border-left: 10px solid teal;
            /* 箭头靠下边 */
            /* left: 25px;
            bottom: -10px;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-top: 10px solid teal; */
            /* 箭头靠左边 */
            /* top: 13px;
            left: -10px;
            border-top: 10px solid transparent;
            border-bottom: 10px solid transparent;
            border-right: 10px solid teal; */
            /* 箭头靠下边 */
            /* top: -10px;
            left: 25px;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-bottom: 10px solid teal; */
        }
        .row-3{
            margin: 20px auto;
            width: 200px;
            height: 50px;
            background: teal;
            /* 箭头靠右边 */
            clip-path: polygon(0 0, 88% 0, 88% 35%, 95% 50%, 88% 65%, 88% 100%, 0 100%);
            /* 箭头靠下边 */
            /* clip-path: polygon(0 0, 100% 0, 100% 85%,35% 85%, 30% 100%,25% 85%,0% 85%); */
            /* 箭头靠左边 */
            /* clip-path: polygon(5% 0, 100% 0, 100% 100%,5% 100%, 5% 65%,0 50%,5% 35%); */
            /* 箭头靠下边 */
            /* clip-path: polygon(0 15%, 25% 15%, 30% 0,35% 15%, 100% 15%,100% 100%,0% 100%); */
            border: 1px solid teal;
        }
        .row-3 div{
            text-align: center;
            line-height: 45px;
            width: 198px;
            height: 48px;
            background: #fff;
            /* 箭头靠右边 */
            clip-path: polygon(0 0, 88% 0, 88% 35%, 95% 50%, 88% 65%, 88% 100%, 0 100%);
            /* 箭头靠下边 */
            /* clip-path: polygon(0 0, 100% 0, 100% 85%,35% 85%, 30% 100%,25% 85%,0% 85%); */
            /* 箭头靠左边 */
            /* clip-path: polygon(5% 0, 100% 0, 100% 100%,5% 100%, 5% 65%,0 50%,5% 35%); */
            /* 箭头靠下边 */
            /* clip-path: polygon(0 15%, 25% 15%, 30% 0,35% 15%, 100% 15%,100% 100%,0% 100%); */
            border: 1px solid #fff;
        }
        .row-4{
            margin: 40px auto;
            width: 200px;
            height: 50px;
            color: #fff;
            line-height: 50px;
            text-align: center;
            position: relative;
            background: teal;
            border-radius: 5px;
        }
        .row-4::after{
            content: '';
            position: absolute;
            width: 0;
            height: 0;
            /* 箭头靠右边 skewY(50deg)和skewY(-50deg)可以调节箭头方向*/
            top: 25px;
            right: -20px;
            border-top: 10px solid transparent;
            border-bottom: 10px solid transparent;
            border-left: 20px solid teal;
            transform: skewY(50deg);
            /* 箭头靠下边 skewX(50deg)和skewX(-50deg)可以调节箭头方向 */
            /* left: 35px;
            bottom: -20px;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-top: 20px solid teal;
            transform: skewX(50deg); */
            /* 箭头靠左边 skewY(50deg)和skewY(-50deg)可以调节箭头方向*/
            /* top: 25px;
            left: -20px;
            border-top: 10px solid transparent;
            border-bottom: 10px solid transparent;
            border-right: 20px solid teal;
            transform: skewY(-50deg); */
            /* 箭头靠下边 skewX(50deg)和skewX(-50deg)可以调节箭头方向*/
            /* left: 25px;
            top: -20px;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-bottom: 20px solid teal;
            transform: skewX(50deg); */
            
        }
        .row-5{
            margin: 20px auto;
            width: 200px;
            height: 50px;
            line-height: 50px;
            text-align: center;
            position: relative;
            border-radius: 5px;
            border: 1px solid teal;
        }
        .row-5::before{
            content: '';
            position: absolute;
            width: 0;
            height: 0;
            /* 箭头靠右边 */
            top: 13px;
            right: -15px;
            border-top: 10px solid transparent;
            border-bottom: 10px solid transparent;
            border-left: 15px solid teal;
            /* 箭头靠下边 */
            /* left: 20px;
            bottom: -15px;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-top: 15px solid teal; */
            /* 箭头靠左边 */
            /* top: 13px;
            left: -15px;
            border-top: 10px solid transparent;
            border-bottom: 10px solid transparent;
            border-right: 15px solid teal; */
            /* 箭头靠下边 */
            /* left: 20px;
            top: -15px;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-bottom: 15px solid teal; */
        }
        .row-5::after{
            content: '';
            position: absolute;
            width: 0;
            height: 0;
            /* 箭头靠右边 */
            top: 13px;
            right: -13px;
            border-top: 10px solid transparent;
            border-bottom: 10px solid transparent;
            border-left: 15px solid #fff;
            /* 箭头靠下边 */
            /* left: 20px;
            bottom: -13px;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-top: 15px solid #fff; */
            /* 箭头靠左边 */
            /* top: 13px;
            left: -13px;
            border-top: 10px solid transparent;
            border-bottom: 10px solid transparent;
            border-right: 15px solid #fff; */
            /* 箭头靠下边 */
            /* left: 20px;
            top: -13px;
            border-left: 10px solid transparent;
            border-right: 10px solid transparent;
            border-bottom: 15px solid #fff; */

最终效果

 

标签:solid,100%,transparent,箭头,10px,border,下拉框,css
From: https://www.cnblogs.com/sgdkg/p/16966510.html

相关文章

  • CSS滚动条样式修改::-webkit-scrollbar
    修改滚动条样式通过伪元素::-webkit-scrollbar;::-webkit-scrollbar-CSS(层叠样式表)|MDN(mozilla.org):-webkit-scrollbar 仅在基于 Blink 或 WebKit 的浏览器,Bli......
  • CSS Grid布局
    Grid局部,当该容器的元素,需要成行成列的排列时,适合使用Grid有两种设置:.grid-container { display: grid;}.grid-container { display: inline-grid;}   ......
  • 三篇不错的介绍CSS GRID的文章
    三篇不错的介绍CSSGRID的文章:​​​http://www.css88.com/archives/8506​​​http://www.css88.com/archives/8512http://www.css88.com/archive......
  • layui多选下拉框插件地址
    地址:https://maplemei.gitee.io/xm-select/#/component/install示例:vardemo1=xmSelect.render({el:"#select_user_box",l......
  • CSS Flex布局
    Flex布局单行多元素,可以考虑Flex布局,好处是居中、对齐比较好控制容器布局,决定使用Flex,横向(rowrow-reverse)还是纵向排列(columncolumn-reverse),是否折行(flex-wrap,......
  • 关于JQuery validate表单校验插件对级联下拉框的校验问题
         今天在使用JQueryvalidate表单校验插件时,遇见了一个非常诡异的问题了。在此记录一下:     问题描述:               ......
  • CSS Margin中5个经典布局解决方案,重难点知识,记得收藏复习
    前几天我在面试前端开发同学的时候,有问到关于margin基础布局相关内容的过程中,发现很多同学基本解释不清楚,今天刚好有点时间就整理了一篇笔记出来。就以下5点在CSS布局经常......
  • vue的watch监听器里面如果使用箭头函数需谨慎
    vue.runtime.esm.js:587[Vuewarn]:Errorincallbackforwatcher"form.psiType":"TypeError:Cannotreadpropertiesofundefined(reading'form')"——————......
  • watch监听器里面如果使用箭头函数需谨慎
    vue.runtime.esm.js:587[Vuewarn]:Errorincallbackforwatcher"form.psiType":"TypeError:Cannotreadpropertiesofundefined(reading'form')"——————......
  • css: button
     input[type="button"],input[type="submit"], button, .button{ border-radius:15px15px15px15px; background:#f3e8e6;/*Oldbrowsers*/ background:......