gpt4 book ai didi

javascript - 如何设置上一个/下一个箭头按钮的样式?

转载 作者:技术小花猫 更新时间:2023-10-29 12:23:04 26 4
gpt4 key购买 nike

GOAL

我一直在尝试修改 slick.css 以适应我在网站中需要的样式。我从 here 得到了 slick.css .

现在

  • 我想让箭头(左+右)变大
  • 对于图标,我想使用周围没有circle-border 的图标。
  • 我喜欢 fa-chevron-rightfa-chevron-left

What have I tried ?

部分 slick.css

.slick-prev, .slick-next { position: absolute; display: block; height: 200px; width: 50px; line-height: 0; font-size: 0; cursor: pointer; background: transparent; color: transparent; top: 50%; margin-top: -10px; padding: 0; border: none; outline: none; }
.slick-prev:hover, .slick-prev:focus, .slick-next:hover, .slick-next:focus { outline: none; background: transparent; color: transparent; }
.slick-prev:hover:before, .slick-prev:focus:before, .slick-next:hover:before, .slick-next:focus:before { opacity: 1; }
.slick-prev.slick-disabled:before, .slick-next.slick-disabled:before { opacity: 0.25; }

.slick-prev:before, .slick-next:before { font-family: "slick"; font-size: 20px; line-height: 1; color: red; opacity: 0.75; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }



.slick-prev { left: -10px; top: 70px; }
[dir="rtl"] .slick-prev { left: auto; right: -10px; top: 70px; }
.slick-prev:before { content: "←"; }
[dir="rtl"] .slick-prev:before { content: "→"; }

.slick-next { right: -10px; top: 70px; }
[dir="rtl"] .slick-next { left: -10px; top: 70px; right: auto; }
.slick-next:before { content: "→"; }
[dir="rtl"] .slick-next:before { content: "←"; }

HTML

<div class="row slick ">
// just a bunch of lists in here
</div>

详细照片

这是我现在拥有的。

enter image description here

这是我想要的。

enter image description here


Question

  • 谁能帮我解决这个问题?

    非常感谢您的考虑和时间。 :)

最佳答案

最基本的是它通过内容属性生成箭头:

.slick-prev:before, .slick-next:before { font-family: "slick"; font-size: 40px; line-height: 1; color: red; opacity: 0.75; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }   

.slick-prev:before { content: "‹"; }
[dir="rtl"] .slick-prev:before { content: "›"; }

[dir="rtl"] .slick-next { left: -10px; top: 70px; right: auto; }
.slick-next:before { content: "›"; }
[dir="rtl"] .slick-next:before { content: "‹"; }

替换这些类,然后使用 margin 和 positions 属性来调整箭头,如果这不能解决问题,请将 http://jsfiddle.net/ 发送给我链接我会把完整的解决方案发给你。

如果想使用 Font Awesome

.slick-prev:before, .slick-next:before { font-family: FontAwesome; font-size: 40px; line-height: 1; color: red; opacity: 0.75; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }   

.slick-prev:before { content: "\f053"; }
[dir="rtl"] .slick-prev:before { content: "\f054"; }

[dir="rtl"] .slick-next { left: -10px; top: 70px; right: auto; }
.slick-next:before { content: "\f054"; }
[dir="rtl"] .slick-next:before { content: "\f053"; }

有关字体图标列表,请访问 http://astronautweb.co/snippet/font-awesome/以及如何实现字体访问这个线程 Use font awesome icon as css content

关于javascript - 如何设置上一个/下一个箭头按钮的样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27403501/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com