PHP Noob
PHP Noob

Reputation: 1615

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?

Upvotes: 3

Views: 603

Answers (2)

Love Trivedi
Love Trivedi

Reputation: 4046

You can use this css for hiding your comma.

.wrap{
    visibility:collapse;
}
.wrap a{
    visibility:visible
}

Upvotes: 2

Martijn
Martijn

Reputation: 16103

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

Upvotes: 4

Related Questions