hover - css command that does the same effect as a.selected, but for a <p> -
i want p
change color click on it, , come original color click on p
. somehow done list of a href
, use command a.selected
.
is possible p
? , how?
thanks.
normally, p
element not selectable, on modern browsers, , html5 cr, can make selectable assigning positive tabindex
value it. clicking on such element set focus on it, , match :focus
pseudo-class. example:
<style> p:focus { color: red; outline: none } </style> <p tabindex=10>hello world! <p tabindex=20>hi again. <p tabindex=30>the end.
the outline: none
declaration included, because without it, browsers draw kind of focus rectangle around element. of course if want rectangle (which different in different browsers), omit declaration or modify it.
Comments
Post a Comment