首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

css3 :selection

2012-08-22 
css3 ::selectionSummaryThe ::-moz-selection (::selection) pseudo-element applies to the portion of

css3 ::selection
Summary

The ::-moz-selection (::selection) pseudo-element applies to the portion of a document that has been highlighted (e.g. selected with the mouse) by the user.

Examples

/* draw any selected text yellow on red background */
::-moz-selection { color: gold;  background: red; }
::selection      { color: gold;  background: red; }

/* draw selected text in a paragraph white on black */
p::-moz-selection { color: white;  background: black; }
p::selection      { color: white;  background: black; }
Notes

Gecko/Firefox supports ::-moz-selection, use also ::selection other browsers.

The following properties apply to ::-moz-selection :
color, background and background-color (background-image is ignored).

Specifications

::selection was drafted for CSS3 Selectors but removed from the current CSS3 draft. Anyhow, it's implemented in browsers and support will continue.

CSS 3 Selectors (Draft 2005-12-15) Obsolete
CSS 3 Selectors #selection Working draft





https://developer.mozilla.org/En/CSS/::selection

热点排行