My question is how can I select this element in CSS by edit
?
element :
<a href="***" class="example1 example2 example3" edit>click</a>
You can use an attribute selector by adding square brackets []
.
Attribute selectors can target:
a[edit]
a[href=***]
But since 'edit' is not a valid attribute for an <a>
-Element, it's advisable to add an data- prefix in the html-code.
a[data-edit]{
background:red;
}
<a href="***" data-edit>edit</a>