Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
November 12, 2019 01:15 am GMT

A Super Weird CSS Bug That Affects Text Selection

You know how you can style (to some degree) selected text with ::selection? Well, Jeff Starr uncovered a heck of a weird CSS bug.

If you:

  1. Leave that selector empty
  2. Link it from an external stylesheet (rather than <style> block)

Selecting text will have no style at all. 😳😬😕

In other words, if you <link rel="stylesheet" ...> up some CSS that includes these empty selectors:

::-moz-selection {}::selection {}

Then text appears to be un-selectable. You actually … Read article

The post A Super Weird CSS Bug That Affects Text Selection appeared first on CSS-Tricks.


Original Link: https://css-tricks.com/a-super-weird-css-bug-that-affects-text-selection/

Share this article:    Share on Facebook
View Full Article

CSS Tricks

A Web Design Community curated by Chris Coyier

More About this Source Visit CSS Tricks