首页 > 电脑专区 > 电脑教程 >

select去掉默认样式;select去掉下拉箭头

来源:互联网 2023-02-21 18:57:28 264

select下拉框有一个下拉箭头样式,那如何去掉这个样式呢?ZPm办公区 - 实用经验教程分享!

可以使用appearance与-ms-expand去掉这个样式。ZPm办公区 - 实用经验教程分享!

代码如下:ZPm办公区 - 实用经验教程分享!

.not-arrow{ZPm办公区 - 实用经验教程分享!

padding: 5px 10px;ZPm办公区 - 实用经验教程分享!

border:1px solid #dcd8d8;ZPm办公区 - 实用经验教程分享!

-webkit-appearance:none;ZPm办公区 - 实用经验教程分享!

-moz-appearance:none;ZPm办公区 - 实用经验教程分享!

appearance:none; /*去掉下拉箭头*/ZPm办公区 - 实用经验教程分享!

}ZPm办公区 - 实用经验教程分享!

/*清除ie的默认选择框样式清除,隐藏下拉箭头*/ZPm办公区 - 实用经验教程分享!

.not-arrow::-ms-expand { display: none; }ZPm办公区 - 实用经验教程分享!

select去掉默认样式;select去掉下拉箭头ZPm办公区 - 实用经验教程分享!

方法/步骤

  • 1

    打开html开发工具,创建一个html代码页面ZPm办公区 - 实用经验教程分享!

    select去掉默认样式;select去掉下拉箭头ZPm办公区 - 实用经验教程分享!

  • 2

    在新建的html代码页面上创建一个select下拉框ZPm办公区 - 实用经验教程分享!

    代码:ZPm办公区 - 实用经验教程分享!

    select name="" id="" >ZPm办公区 - 实用经验教程分享!

    option>下拉菜单去掉箭头1/option>ZPm办公区 - 实用经验教程分享!

    option>下拉菜单去掉箭头2/option>ZPm办公区 - 实用经验教程分享!

    option>下拉菜单去掉箭头3/option>ZPm办公区 - 实用经验教程分享!

    option>下拉菜单去掉箭头4/option>ZPm办公区 - 实用经验教程分享!

    option>下拉菜单去掉箭头5/option>ZPm办公区 - 实用经验教程分享!

    option>下拉菜单去掉箭头6/option>ZPm办公区 - 实用经验教程分享!

    /select>ZPm办公区 - 实用经验教程分享!

    select去掉默认样式;select去掉下拉箭头ZPm办公区 - 实用经验教程分享!

  • 3

    设置去掉下拉箭头样式。通过使用appearance、-ms-expand去掉select的下拉箭头ZPm办公区 - 实用经验教程分享!

    样式代码:ZPm办公区 - 实用经验教程分享!

    .not-arrow{ZPm办公区 - 实用经验教程分享!

    padding: 5px 10px;ZPm办公区 - 实用经验教程分享!

    border:1px solid #dcd8d8;ZPm办公区 - 实用经验教程分享!

    -webkit-appearance:none;ZPm办公区 - 实用经验教程分享!

    -moz-appearance:none;ZPm办公区 - 实用经验教程分享!

    appearance:none; /*去掉下拉箭头*/ZPm办公区 - 实用经验教程分享!

    }ZPm办公区 - 实用经验教程分享!

    /*清除ie的默认选择框样式清除,隐藏下拉箭头*/ZPm办公区 - 实用经验教程分享!

    .not-arrow::-ms-expand { display: none; }ZPm办公区 - 实用经验教程分享!

    select去掉默认样式;select去掉下拉箭头ZPm办公区 - 实用经验教程分享!

  • 4

    为select添加去掉下拉箭头样式(案例中下拉样式类为not-arrow)ZPm办公区 - 实用经验教程分享!

    select去掉默认样式;select去掉下拉箭头ZPm办公区 - 实用经验教程分享!

  • 5

    保存html代码页面,然后使用浏览器打开,即可看到select已没有下拉的箭头ZPm办公区 - 实用经验教程分享!

    select去掉默认样式;select去掉下拉箭头ZPm办公区 - 实用经验教程分享!

  • 5本页面未经许可获取自百度经验
  • 6

    所有代码,可以直接复制所有代码粘贴到新建html页面保存后打开即可看到所有效果ZPm办公区 - 实用经验教程分享!

    所有代码:ZPm办公区 - 实用经验教程分享!

    !DOCTYPE html>ZPm办公区 - 实用经验教程分享!

    html>ZPm办公区 - 实用经验教程分享!

    head>ZPm办公区 - 实用经验教程分享!

    meta charset="UTF-8">ZPm办公区 - 实用经验教程分享!

    title>select去掉默认样式/title>ZPm办公区 - 实用经验教程分享!

    style type="text/css">ZPm办公区 - 实用经验教程分享!

    .not-arrow{ZPm办公区 - 实用经验教程分享!

    padding: 5px 10px;ZPm办公区 - 实用经验教程分享!

    border:1px solid #dcd8d8;ZPm办公区 - 实用经验教程分享!

    -webkit-appearance:none;ZPm办公区 - 实用经验教程分享!

    -moz-appearance:none;ZPm办公区 - 实用经验教程分享!

    appearance:none; /*去掉下拉箭头*/ZPm办公区 - 实用经验教程分享!

    }ZPm办公区 - 实用经验教程分享!

    /*清除ie的默认选择框样式清除,隐藏下拉箭头*/ZPm办公区 - 实用经验教程分享!

    .not-arrow::-ms-expand { display: none; }ZPm办公区 - 实用经验教程分享!

    /style>ZPm办公区 - 实用经验教程分享!

    /head>ZPm办公区 - 实用经验教程分享!

    body>ZPm办公区 - 实用经验教程分享!

    select name="" id="" class="not-arrow">ZPm办公区 - 实用经验教程分享!

    option>下拉菜单去掉箭头1/option>ZPm办公区 - 实用经验教程分享!

    option>下拉菜单去掉箭头2/option>ZPm办公区 - 实用经验教程分享!

    option>下拉菜单去掉箭头3/option>ZPm办公区 - 实用经验教程分享!

    option>下拉菜单去掉箭头4/option>ZPm办公区 - 实用经验教程分享!

    option>下拉菜单去掉箭头5/option>ZPm办公区 - 实用经验教程分享!

    option>下拉菜单去掉箭头6/option>ZPm办公区 - 实用经验教程分享!

    /select>ZPm办公区 - 实用经验教程分享!

    /body>ZPm办公区 - 实用经验教程分享!

    /html>ZPm办公区 - 实用经验教程分享!

    select去掉默认样式;select去掉下拉箭头ZPm办公区 - 实用经验教程分享!

  • 以上方法由办公区教程网编辑摘抄自百度经验可供大家参考!ZPm办公区 - 实用经验教程分享!


    标签: 操作系统默认样式箭头

    办公区 Copyright © 2016-2023 www.bgqu.net. Some Rights Reserved. 备案号:湘ICP备2020019561号统计代码