user-select: unset | none, How to override |
user-select: unset | none, How to override |
Dag |
Dec 19 2019, 05:44 AM
Post
#1
|
Advanced Member Group: Members Posts: 107 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 ) Is there any way to solve this issue? Override or something... Thanks in advance. |
Christian J |
Dec 19 2019, 07:12 AM
Post
#2
|
. Group: WDG Moderators Posts: 9,630 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.) |
Dag |
Dec 19 2019, 09:50 AM
Post
#3
|
Advanced Member Group: Members Posts: 107 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) {...} 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.) |
Dag |
Dec 19 2019, 09:54 AM
Post
#4
|
Advanced Member Group: Members Posts: 107 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 |
Christian J |
Dec 19 2019, 10:31 AM
Post
#5
|
. Group: WDG Moderators Posts: 9,630 Joined: 10-August 06 Member No.: 7 |
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 |
Dag |
Dec 20 2019, 01:51 AM
Post
#6
|
Advanced Member Group: Members Posts: 107 Joined: 24-October 06 Member No.: 549 |
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)! 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. |
Christian J |
Dec 20 2019, 07:30 AM
Post
#7
|
. Group: WDG Moderators Posts: 9,630 Joined: 10-August 06 Member No.: 7 |
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. |
Lo-Fi Version | Time is now: 29th March 2024 - 07:57 AM |