1

I don't have access to html, but i want to test something... How would I select the text boomboomboom and hide it with CSS...

the markup looks like this:

<div class="bla">
  <div>
    <strong>some text</strong>
    <br />
    boomboomboom
  </div>
</div>

I tryed this:

.bla div {
  text-indent: -9999px;
}
.bla div strong {
  text-indent: 0px;
}

but this just hides "some text" instead of "boomboomboom"...

can anyone help me? http://jsfiddle.net/b26N7/1/

1
  • 1
    I dont think this is possible with css only.. you can use javascript to do it, css is based on elements, id, class not text Commented Jan 9, 2014 at 9:20

2 Answers 2

3

Check this topic, it's the same thing.

Conclusion is, you can't select the text node with the css at this moment(without wraping it in a html element), but you can do it with JavaScript.

0
-1

Remove <br /> to separate the "boomboomboom" in next line.
You can use "display:block" to show the "boomboomboom" in next line.

Then your css will work properly.

Example: http://jsfiddle.net/uL9Rg/

1
  • He wanted to hide only the unwraped text node inside his div, not all the content
    – n1kkou
    Commented Jan 9, 2014 at 9:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.