css清除css样式
The goal of CSS is to allow styling of content and structure within a web page. We all know that, right? As CSS revisions arrive, we're provided more opportunity to control. One of the little known styling option available within the browser is text selection styling. Windows provides an ugly dark blue color for text selection and Mac provides a lighter blue color. Mozilla Firefox, Internet Explorer 9, Opera, and Webkit-based browsers allow you to customize the styling of selected text. Let me show you how.
CSS的目标是允许样式化网页内的内容和结构。 我们都知道,对不对? 随着CSS修订版本的到来,我们将获得更多的控制机会。 浏览器中鲜为人知的样式选项之一是文本选择样式。 Windows提供了丑陋的深蓝色用于文本选择,而Mac提供了较浅的蓝色。 使用Mozilla Firefox,Internet Explorer 9,Opera和基于Webkit的浏览器,可以自定义所选文本的样式。 让我告诉你怎么做。
CSS (The CSS)
/* webkit, opera, IE9 */
::selection { background:lightblue; }
/* mozilla firefox */
::-moz-selection { background:lightblue; }
The -moz prefixed property is obviously for Firefox while the basic ::selection selector is for Webkit-based browsers. Much like the other CSS selectors, you can nest usage of selection to use different colors in different places and depths:
-moz前缀属性显然适用于Firefox,而基本:: selection选择器适用于基于Webkit的浏览器。 与其他CSS选择器非常相似,您可以嵌套使用选择,以在不同的位置和深度使用不同的颜色:
/* webkit, opera, IE9 */
div.highlightBlue::selection { background:lightblue; }
/* mozilla firefox */
div.highlightBlue::-moz-selection { background:lightblue; }
/* webkit, opera, IE9 */
div.highlightPink::selection { background:pink; }
/* mozilla firefox */
div.highlightPink::-moz-selection { background:pink; }
CSS selection styling is just another one of those simple touches you can add to make your website more refined and vibrant!
CSS选择样式只是您可以添加的一些简单操作中的一种,可以使您的网站更加精致和生动!
css清除css样式