The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> user-select: unset | none, How to override
Dag
post Dec 19 2019, 05:44 AM
Post #1


Member
***

Group: Members
Posts: 97
Joined: 24-October 06
Member No.: 549



The genious webmaster decided that I should not copy his content, which is in public anyway, so (s)he wrote in his default.css:
CODE

* {
    user-select: none !important;
    -moz-user-select: none !important;
    -webkit-user-select: none !important;
    -ms-user-select: none !important;
    }


!important everywhere of course... So, I wrote in my css for customization (I should use one line only but never mind):
CODE

* {
    user-select: unset !important;
    -moz-user-select: all !important;
    -webkit-user-select: all !important;
    -ms-user-select: element !important;
    }

and my !important is more important than his !important.

I need to keep in one of his sections "user-select: none" but now it is not possible. My first !important is more important than mine second !important smile.gif) Is there any way to solve this issue? Override or something...

Thanks in advance.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Dec 19 2019, 07:12 AM
Post #2


.
********

Group: WDG Moderators
Posts: 8,345
Joined: 10-August 06
Member No.: 7



Can't you add another style block:

CODE

* {
    user-select: all !important;
    -moz-user-select: all !important;
    -webkit-user-select: all !important;
    -ms-user-select: element !important;
    }

section {
    user-select: none !important;
    -moz-user-select: none !important;
    -webkit-user-select: none !important;
    -ms-user-select: none !important;
}

?

(I don't think "unset" is a valid value.)
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Dag
post Dec 19 2019, 09:50 AM
Post #3


Member
***

Group: Members
Posts: 97
Joined: 24-October 06
Member No.: 549



Unset I copied from somewhere... DUnno does it works... I am uzing-mozillass

I did exactly that what you wrote but without effect...

Maybe there sre some exclussions in the first directive? Something as:
* (but not/exclude section id 3) {...}

QUOTE(Christian J @ Dec 19 2019, 04:12 PM) *

Can't you add another style block:

CODE

* {
    user-select: all !important;
    -moz-user-select: all !important;
    -webkit-user-select: all !important;
    -ms-user-select: element !important;
    }

section {
    user-select: none !important;
    -moz-user-select: none !important;
    -webkit-user-select: none !important;
    -ms-user-select: none !important;
}

?

(I don't think "unset" is a valid value.)

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Dag
post Dec 19 2019, 09:54 AM
Post #4


Member
***

Group: Members
Posts: 97
Joined: 24-October 06
Member No.: 549



Idea...

Maybe to turn the order? First section and then * ?
Or to try inherit?

This post has been edited by Dag: Dec 19 2019, 09:56 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Dec 19 2019, 10:31 AM
Post #5


.
********

Group: WDG Moderators
Posts: 8,345
Joined: 10-August 06
Member No.: 7



QUOTE(Dag @ Dec 19 2019, 03:50 PM) *

I did exactly that what you wrote but without effect...

I didn't test with a User stylesheet, maybe you must restart the browser after every change to the CSS file?

QUOTE
Maybe there sre some exclussions in the first directive? Something as:
* (but not/exclude section id 3) {...}

This works on my test page:

CODE
:not(section) {
    user-select: all !important;
    -moz-user-select: all !important;
    -webkit-user-select: all !important;
    -ms-user-select: element !important;
    }

https://developer.mozilla.org/en-US/docs/Web/CSS/:not
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Dag
post Dec 20 2019, 01:51 AM
Post #6


Member
***

Group: Members
Posts: 97
Joined: 24-October 06
Member No.: 549



QUOTE(Christian J @ Dec 19 2019, 07:31 PM) *

I didn't test with a User stylesheet, maybe you must restart the browser after every change to the CSS file?

Restart is obligatory always. But you can't override '* all'. And I think not because of !important 1 rule versus !important 2 rule (rule 1 can't be overwritten) but because of absent section in * directive. You can't override apples with pears. If I wrote
CODE
section_x {
    user-select: all !important;
    }

and then
CODE
section_x {
    user-select: none !important;
    }

it should work! But I had no choice. To override their directive, I have to use the same their element (for the start point)!

QUOTE(Christian J @ Dec 19 2019, 07:31 PM) *

This works on my test page:
CODE
:not(section) {
    user-select: all !important;
    -moz-user-select: all !important;
    -webkit-user-select: all !important;
    -ms-user-select: element !important;
    }

https://developer.mozilla.org/en-US/docs/Web/CSS/:not

Yes yes... I remember that ':not'... This must work. I'll try and than write (and thanks) again.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Dec 20 2019, 07:30 AM
Post #7


.
********

Group: WDG Moderators
Posts: 8,345
Joined: 10-August 06
Member No.: 7



QUOTE(Dag @ Dec 20 2019, 07:51 AM) *

But you can't override '* all'.

Yes you can:

CODE
* {color: red;}
p {color: blue;}

But see also https://www.w3.org/TR/2011/REC-CSS2-2011060...versal-selector

QUOTE
*[lang=fr] and [lang=fr] are equivalent.
*.warning and .warning are equivalent.
*#myid and #myid are equivalent.


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 3rd April 2020 - 06:58 AM