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主题中的默认文本选择颜色。
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文本框