Issue
I want to create the selector using a tag href attributes. I try the below one but not working well. Please check the below code
HTML
<a href="https://google.com/">Google</a> <a href="https://codepen.io/pen/">Codepen</a>
CSS
ahref="https://google.com/" { background-color: #f00; color: #fff; padding: 10px; }
Solution
You can use it like this. Also Here I attached the codepen. Plesae try this
a[href="https://google.com/"] {
background-color: #f00;
color: #fff;
padding: 10px;
}
https://codepen.io/ashok-kannan-dev/pen/mdpWLvG
Answered By - Ashok K
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.