wordpress文本框_如何在WordPress中更改默认的文本选择颜色

wordpress文本框

You know what makes your website’s design stand out? Attention to details. One of these details that caught our attention on Brian Gardner’s (@bgardner) website was the way his default text selection color matched his design color scheme rather than being the default blue color. In this article, we will show you how to change the default text selection color in your WordPress theme.

您知道什么使您的网站设计脱颖而出吗? 注意详情。 这些细节之一引起我们在Brian Gardner(@bgardner)网站上的关注,是他的默认文本选择颜色与他的设计配色方案相匹配的方式,而不是默认的蓝色。 在本文中,我们将向您展示如何更改WordPress主题中的默认文本选择颜色。

Change the Default Text Selection Color

Open your style.css file and add the following styles:

打开您的style.css文件并添加以下样式:


::-moz-selection {
    background-color: #ff6200;
    color: #fff;
}

::selection {
    background-color: #ff6200;
    color: #fff;
}

Don’t forget to change the background color to match your theme’s color scheme.

不要忘记更改背景颜色以匹配主题的配色方案。

The ::selection selector is used by Chrome, Safari, IE9+, and Opera. Firefox likes to use their own ::-moz-selection. This is the reason why they are on two separate lines. If you try to combine them, it will not work.

Chrome,Safari,IE9 +和Opera使用:: selection选择器。 Firefox喜欢使用自己的:::-moz-selection。 这就是为什么它们位于两条不同的线上的原因。 如果您尝试将它们组合在一起,它将无法正常工作。

For demo, simply select any of the text on this site.

对于演示,只需选择此站点上的任何文本。

Source: Brian Gardner

资料来源: Brian Gardner

翻译自: https://www.wpbeginner.com/wp-themes/how-to-change-the-default-text-selection-color-in-wordpress/

wordpress文本框

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值