Bootstrap 4更改汉堡图标颜色方法

Kevin 杂记 1,825 次浏览 27条评论

Bootstrap 4提供的CSS预设颜色种类不多,往往默认的不够使用。当修改菜单栏底色后,移动端视图的汉堡菜单图标可能显示不搭,颜色或深或浅。一般这个问题我们会找到CSS类自定义解决,但.navbar-toggler-icon这个类修改方法有所不同,直接添加color属性无效,需要覆盖background-image这个属性。

先用Chrome开发者工具定位CSS类名称,这个属性不好复制,复制不完全。建议打开bootstrap.min.css文件查找。原始CSS属性值是这样的:

.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}

修改里面的stroke='rgba(255, 255, 255, 0.5)'数据更改颜色,然后添加到你自定义CSS文件里就可以了。

评论列表

  1. #1

    brand name dapoxetine no generic https://salemeds24.wixsite.com/dapoxetine

  2. #2

    is generic vidalista safe https://vidalista.mlsmalta.com/

  3. #3

    is hydroxychloroquine expensive https://hydroxychloroquine.mlsmalta.com/

  4. #4

    how do i buy cialis online http://www.lm360.us/

  5. #5

    womens ivermectin fda https://ivermectin.webbfenix.com/

  6. #6

    dosing for ivermectin https://ivermectin.mlsmalta.com/

  7. #7

    bactrim for urinary tract infection https://keflex.webbfenix.com/

  8. #8

    sildenafil citrate 50 mg tablets http://droga5.net/

  9. #9

    success with hydroxychloroquine https://hhydroxychloroquine.com/

  10. #10

    60mg dapoxetine cost https://ddapoxetine.com/

  11. #11

    generic vidalista daily use https://vidalista40mg.mlsmalta.com/

  12. #12

    tadalafil tablets for sale https://wisig.org/

  13. #13

    cvs pickup curbside https://buymeds.mlsmalta.com/

  14. #14

    cvs pickup curbside https://medpills.bee-rich.com/

  15. #15

    inhalers for asthma online https://amstyles.com/

  16. #16

    hydroxychloroquine works against covid https://hydroxychloroquinee.com/

  17. #17

    coupon for cialis by manufacturer https://atadalafil.online/

  18. #18

    coupon for cialis by manufacturer https://tadalafil24.online/

  19. #19

    how quickly does vidalista work https://vidalista.buszcentrum.com/

  20. #20

    grapefruit juice and cialis http://cleckleyfloors.com/

  21. #21

    hydroxychloroquine clinical trial in france https://hydroxychloroquine.grassfed.us/

  22. #22

    hydroxychloroquine clinical trial in france https://hydroxychloroquine.mymvrc.org/

  23. #23

    cialis manufacturer offer https://cialis.lm360.us/

  24. #24

    cialis manufacturer offer https://cialis.stdstory.com/

  25. #25

    cialis daily use cost https://cialis.mlsmalta.com/

  26. #26

    cialis daily use cost https://cialis360.jueriy.com/

  27. #27

    cialis 5mg canada pharmacy http://cialis.anafassia.com/

发表评论

电邮地址用于 Gravatar 头像显示,不会被公开可见。