We all know that the default background color is blue after the page text is selected on the browser. For designers who like to pursue their own personality, the same color seems too hard to pursue, the following describes how to customize the color of the selected text in the browser to fully display the personalized design! In fact, it is mainly implemented using some small features of CSS3. There is nothing special about it. See the following sample code.
(1) Change the selected text style of the entire page as follows:
::selection { background:#ff0033; color:#555;}::-moz-selection { background:#ff0033; color:#555;}::-webkit-selection { background:#ff0033; color:#555;}
The preceding settings change the background color of the selected text to red.
(2) set the style status after the selected content and text of the specified content block on the page. For example:
.ac_content::selection { background:#000; color:#fff;}.ac_content::-moz-selection { background:#000; color:#fff;}.ac_content::-webkit-selection { background:#000; color:#fff;}
The above settings will change the selected text in the ac_content block of the class in the page to black and white.
Articles you may be interested in
- Css controls code for force-breaking and non-wrapping in English and Chinese
- Windows cannot start the hardware device because its configuration information (in the Registry) is incomplete or damaged. (Code 19) Solution
- Key search engine technologies: Introduction to Chinese Word Segmentation
- Prohibit web page right-click, copy, save as, View Source file and other functions to implement web page source code protection
- Jquery drop-down menu (ultra-simple and practical, compatible with mainstream browsers such as IE and firefox)
- Php obtains the start and end timestamps of today, yesterday, last week, and this month.
- Php clears (deletes) the files in the specified directory, and does not delete the directory folder.
- Conversion of date and unix timestamps in php and mysql