0

I have tried to search but am not sure if I am posing the question right.

I applied the following css to my site:

a[target='_blank']::after {
    content: '\29C9';
}

This means that all external links will get the icon attached to it. So far, so good, it works as expected.

There are some situations though where I do not want this to happen, like in social share buttons. How can I exclude some classes?

Like when the link appears in a div with class 'socialbutton'?

PS I cannot add other style to these buttons (WordPress website and generated code)

1

2 Answers 2

3

You can overwrite this css code by adding new css to the class.

Example you can overcome this:

a[target='_blank']::after {
    content: '\29C9';
}

By doing this:

.socialbutton::after {
    content: '\fff' !important;
}
Sign up to request clarification or add additional context in comments.

2 Comments

Yes, that was it. I modified it slightly to: '.social-icons a::after { content: '' !important; }' and that did the trick. Thank you, @Smokinggunz !
If this worked please accept my answer. @MarjanCrabtree-theICTgirl
1

You can use the :not() selector:

a[target='_blank']:not(.social)::after {
    content: '\29C9';
}

2 Comments

That works only if the links themselves have that class, but the question was about them being in a parent element with that class.
@CBroe Oops, I must haved missed that part, nevermind... :/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.