Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS selector for content of an element tag

This sound silly, but I want to apply a CSS to a content inside and element tag.

Example:

<div class="wrap">
    <a href="#">Tag 1</a>
    ,
    <a href="#">Tag 2</a>
    ,
    <a href="#">Tag 3</a>
</div>

Is there any possibility that I'll be able to remove or hide the comma , every between the tag using CSS? I have no idea how to tweak a generated output for tags that contains comma.. so I was thinking if this would be possible using CSS?

like image 299
PHP Noob Avatar asked Jan 26 '26 23:01

PHP Noob


1 Answers

This might work, allthough css might not be the best way. How did they get there in the first place... Css is for style (hence StyleSheet), not for content.

.wrap{
    visibility:collapse;
}

.wrap a{
    visibility:visible;
}

And a jsFiddle demo
CSS3 selectors are fun, but can be difficult to understand what is happening, and the support for older browsers is minimal.

Hide text node in element, but not children

like image 71
Martijn Avatar answered Jan 29 '26 13:01

Martijn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!