No colons are allowed in CSS classes. It is therefore absolutely correct for WordPress to adapt this input.
Why do you want to use a colon here at all?
Hi @threadi. Colons are permitted when specifying pseudoclasses. I want to specify what happens when the cursor hovers over the menu item.
For example, hover:bg-red-600
would turn the menu item’s background to red when the mouse hovered over the menu item.
I can apply this and it works using the functions.php, but cannot do so with the Admin fields.
-
This reply was modified 1 year, 3 months ago by
maxweld.
You specify pseudo classes in the CSS, never in the HTML code.
Example:
If you give the menu item the class bg-red-600 (and only that, written exactly like that) then you have to write it in the CSS:
.bg-red-600:hover { background-color: red; }
Even if the term “pseudo class” suggests it, these are not real classes that are stored in the HTML code. “Pseudo” simply means that they are not. They are only used in the CSS code – not in HTML.