Change text color with style tag

Using CSS, it's easy to apply a custom color to a link when you hover over it using:

.myId:hover{
    color:green;
}

But what about a style tag? You can do something line by line:

<a style="*insert nifty markup here to change color on hover*" href="somewhere.html">text</a>

Or the hover color changes only according to the first method (using only html / css, javascript is not allowed).

+3
source share
3 answers

You cannot and should not do this. Give it a class or id and a stylesheet.

+6
source

No , I don’t think you can change states or add selectors via a style tag.

+2
source

AFAIK <style> <head>, .

- . , . CSS :) (imo)

+1

Source: https://habr.com/ru/post/1796045/


All Articles