Streaming live at 10am (PST)

Do Webflow have a similar feature to the "user-select" css property?


#1

Hello everyone!

I'm currently working on some site-polishing, and wanted to make it so that people can't highlight text (headers and so on). The reason being that I personally think it ruines the sites visuals and immersion, when that blue highlighting color suddenly appears while you browse the website. I know there is a css property that does this; Its called "user-select" I've look everywhere for anything giving the same result as this, but sadly I simply failed to find anything, so now I'm seeking help from you wise guys (and girls) here on the forum. :relaxed:

Have a nice day! - Best regards Tobias Gade.


Links:

The css property I'm referring to: https://css-tricks.com/almanac/properties/u/user-select/


#2

Hey @TobiasFG,

At this time you can't do this with the Webflow designer. What you can do, is add this to your head code:

<style>
::-moz-selection { 
	background: black;
    color: white
}
::selection {
	background: black;
  	color: white
}
</style>

Hope this helps


#3

Thanks for the Quick response, sadly I don't have access to the custom code, so I guess i'll have to wait till I upgrade.

however, I see one slight problem with the solution you mentioned;

If i where to do that, wouldn't i only work on a black webpage with white text? At least that's what it seems like from my testing;
with the result being;
Or have I got it all wrong?..

I tired setting it to "transparent" without specifying any color, and that seems to work for all combinations of background color and text color;
Result;
However that will effect all elements, and not only headers and key-text.

If I want to achieve the option to choose which elements cannot be highlighted, I would then need to do something like;

And then add that class to all elements, that I dont want to be highlighted, right?

Sorry for the insanely long response.. :sweat_smile:


#4

@TobiasFG I used black and white but you can use any color(s) you want.

Yes you are correct, you could use something like .yourclass::-moz-selection to target specific parts of your design.

You might wanna give this a look: https://css-tricks.com/almanac/selectors/s/selection/


#5

Thanks for the help, then I'm all set for now.

  • Have a nice day.

#6

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.