A long time no ' shell ', recently in a company to do a production management solution. So they're all very busy. Today's topic is very simple, make a very simple web effect. Today by chance to browse to a website, they choose text, look not blue background and white font so monotonous, feel so good. At least, it looks different from other people's.
In fact, he's using a pseudo-object selector for CSS3: selection. This will change the style of the selected text. Demo. This is actually not a lot of technical content, but will be little bit to share with you.
<!DOCTYPE HTML><HTML><Head> <title></title> <MetaCharSet= "Utf-8"></Head><style> /*WebKit, opera, IE9*/div::selection{background:Red;Color:#fff; } /*Mozilla Firefox*/div::-moz-selection{background:Red;Color:#fff; } /*WebKit, opera, IE9*/div::selection{background:Pink;Color:#fff; } /*Mozilla Firefox*/div::-moz-selection{background:Red;Color:#fff; }</style><Body><Div>Hi, every body, I am Steven. Nice to meet.<BR>Welcome to my blog!</Div></Body></HTML>
Let's give it a try! Reprint Please specify source: http://zhutty.cnblogs.com
[Original works]html CSS change browser select text background and color