Comments on: ::selection https://css-tricks.com Tips, Tricks, and Techniques on using Cascading Style Sheets. Mon, 14 Feb 2022 15:49:04 +0000 hourly 1 https://wordpress.org/?v=6.4.3 By: Maisha https://css-tricks.com/almanac/selectors/s/selection/#comment-1712289 Sun, 02 Jun 2019 07:10:06 +0000 http://css-tricks.com/?page_id=181092#comment-1712289 I have read a lot of articles here in this site but most of them had little info about actual problem or very badly written or sometimes useless. But this article is very good. I really liked it. It is very well written and portrayed. I feel like I learned a lot and have scope to learn more.

]]>
By: Grzegorz https://css-tricks.com/almanac/selectors/s/selection/#comment-1633965 Thu, 24 May 2018 10:14:12 +0000 http://css-tricks.com/?page_id=181092#comment-1633965 Does anyone have maybe an idea how to reset ::selection attributes back to browser defaults? I have a problem when used vuematerial, that sets some custom colors.

]]>
By: Toon https://css-tricks.com/almanac/selectors/s/selection/#comment-1617878 Thu, 22 Mar 2018 15:53:21 +0000 http://css-tricks.com/?page_id=181092#comment-1617878 In reply to Romain Petit.

It’s a Chrome and Safari thing. Make the color just slightly transparent, like this rgba(255,255,255,0.99) and it (almost) appears as white. And it works with every color, not just white ;-)

]]>
By: Romain Petit https://css-tricks.com/almanac/selectors/s/selection/#comment-1607750 Fri, 31 Mar 2017 11:06:27 +0000 http://css-tricks.com/?page_id=181092#comment-1607750 Webkit specific question.
Did you notice that ::selection{ background-color: white } does not create a perfectly white background ? Instead, it shows a grey background (#989898)

It seems like the perfect white color (#fff) is forbidden. My guess is that it’s to make sure that the selection is visible enough : most pages having a white background, a selection background set to the same color would not contrast at all.

I asked this on Stack Overflow and it didn’t raise much interest so far http://stackoverflow.com/questions/32820767/css-text-selection-styling-can-not-make-background-white

Do you have any idea ? Do you experience the same in Webkit browsers ?

]]>
By: sohil https://css-tricks.com/almanac/selectors/s/selection/#comment-1607056 Mon, 27 Feb 2017 13:39:05 +0000 http://css-tricks.com/?page_id=181092#comment-1607056 background: linear-gradient(to right, #EB3349 0%, #F45C43 50%);
doesn’t work for ::selection. is there any way to do that?

]]>
By: anonymous https://css-tricks.com/almanac/selectors/s/selection/#comment-1605563 Wed, 14 Dec 2016 04:44:20 +0000 http://css-tricks.com/?page_id=181092#comment-1605563 In reply to Kay.

Sorry. There is no way.

]]>
By: johnny Much https://css-tricks.com/almanac/selectors/s/selection/#comment-1605164 Wed, 23 Nov 2016 07:50:22 +0000 http://css-tricks.com/?page_id=181092#comment-1605164 In reply to Pankaj Prakash.

Nice for using

]]>
By: Oscar Tini https://css-tricks.com/almanac/selectors/s/selection/#comment-1603375 Thu, 11 Aug 2016 16:41:22 +0000 http://css-tricks.com/?page_id=181092#comment-1603375 I’m not sure if this will be ever needed, but it’s quite cool.

]]>
By: Ivan https://css-tricks.com/almanac/selectors/s/selection/#comment-1602400 Thu, 23 Jun 2016 00:07:18 +0000 http://css-tricks.com/?page_id=181092#comment-1602400 ::selection is now part of the CSS Pseudo-Elements Level 4 Working Draft. So it does probably work on most places.
https://developer.mozilla.org/en-US/docs/Web/CSS/::selection#Summary

]]>
By: Amir https://css-tricks.com/almanac/selectors/s/selection/#comment-1595737 Thu, 09 Jul 2015 11:11:21 +0000 http://css-tricks.com/?page_id=181092#comment-1595737 Hi, I have a problem with this page in mozilla Firefox Developer Edition 39.0a2 (2015-04-22), when i scroll up to header an div with absolute position and black background color show on top, and i can not see other elements of page.

But when scoll down to “What’s your take on managing styles entirely in JavaScript?” div this will remove!

]]>
By: Kay https://css-tricks.com/almanac/selectors/s/selection/#comment-1595343 Tue, 23 Jun 2015 09:39:52 +0000 http://css-tricks.com/?page_id=181092#comment-1595343 Hi,

I know it says that this isn’t going to work for IOS, but is there a way to get a workaround for IOS? I’ve got things working for all other browsers, but we also need this for IOS.

With kind regards,
Kay

]]>
By: Diego Crusius https://css-tricks.com/almanac/selectors/s/selection/#comment-1595215 Sun, 14 Jun 2015 14:10:11 +0000 http://css-tricks.com/?page_id=181092#comment-1595215 Hi.

I am having trouble with anchors. I want all my selected areas to be red so I add a simple ::selection{ background-color: red } and everything works fine, but when I add links to my document there is always a line bellow the tag that still gets the default color.

I see no reason to post code here since it happens everywhere. Thanks.

]]>
By: Pankaj Prakash https://css-tricks.com/almanac/selectors/s/selection/#comment-1594329 Fri, 08 May 2015 08:03:26 +0000 http://css-tricks.com/?page_id=181092#comment-1594329 nice article here my blog have a look http://codeforwin.blogspot.in/

]]>