Reputation: 21
I need to hide <a>
tag coming after <span>
there is no class available on <a>
and I am working on a script coming from third party so i just need to hide <a>
script using css, I have no much knowledge about css so please let me know. I think this can be done using css.
<span class = "hidea">abc</span>
<a href = ""> hide me </a>
Upvotes: 0
Views: 145
Reputation: 15913
You can use the adjacent sibling selector (+)
which will select the specified element that immediately follows the former one
.hidea + a { display: none; }
<span class = "hidea">abc</span>
<a href = ""> hide me </a>
Upvotes: 0
Reputation: 17366
You can use adjacent siblings selector
.hidea + a{
display:none;
}
Upvotes: 1
Reputation: 123377
use the adjacent sibling selector (+)
.hidea + a { display: none; }
From https://developer.mozilla.org/en-US/docs/Web/CSS/Adjacent_sibling_selectors
[...] It will select only the specified element that immediately follows the former specified element.
Upvotes: 2