I have the following styling setup to apply an icon to external links, but I'm having an issue where it's applying to images that are a child of the anchor tag, which I do not want.
a:not(.btn) {
&[target="_blank"] {
&:after {
// The styles I want to apply
}
}
}
I've attempted to use the following img:not(:first-child)
selector to wrap the block, but it does not seem to do what I want it to.
a:not(.btn) {
&[target="_blank"] + img:not(:first-child) {
&:after {
// The styles I want to apply
}
}
}
What is the correct way to adjust this code where it will correctly apply to any anchor tags with target="_blank"
but not to those when an img
tag is a child.