0
<div class="breadcrumb">
<h2 class="element-invisible">You are here</h2>
<a href="/cashback/">Home</a> 
admin
</div>

Can any one suggest how to remove the "admin" from the above html by using css? I can't modify the html directly.

Michael Slade
  • 13,802
  • 2
  • 39
  • 44
Gladiator
  • 135
  • 1
  • 7
  • 1
    the only way to achieve this is to have a css selector that selects only text node, and apply `display:none` to it. Unfortunately, there isn't, so your question is unanswerable using css alone :( http://stackoverflow.com/questions/5688712/is-there-a-css-selector-for-text-nodes-elements – Andreas Wong May 23 '12 at 07:01
  • Can you use javascript? can you put a ` – Michael Slade May 23 '12 at 07:11
  • take a look, using javascript http://www.randomsnippets.com/2008/03/07/how-to-find-and-replace-text-dynamically-via-javascript/ – Rafee May 23 '12 at 07:13
  • Thank you all:):) I never thought i would such a support from u all. Wesley's solution provided the trick in my case. Once again thanks a lot buddies:):) – Gladiator May 23 '12 at 09:39

5 Answers5

3

There is a way to do this with just CSS:

.breadcrumb {
    visibility: hidden;
}

.breadcrumb * {
    visibility: visible;
}
Wesley
  • 2,204
  • 15
  • 14
1

you can use str_replace('admin','',$var_name); if you have variable of this html.

Botz3000
  • 39,020
  • 8
  • 103
  • 127
0

You can use:

<span style="display:none;">admin</span>

Kapil Khandelwal
  • 15,958
  • 2
  • 45
  • 52
  • Thanks for your answer kapil. These codes are from Drupal. I cannot customise them. So is there any other means by which i can hide them? – Gladiator May 23 '12 at 07:06
0

Try using position relative with a negative left position, I don't know if you can apply those styles with no problem in your Drupal site, but at least it works in the fiddle.
http://jsfiddle.net/cadence96/M5pfV/1/

First give a relative position to the container moving it away of the view applying a css style of left: -9999px
then select the children elements, give them position relative, and style them with left: 9999px, this way you'll get your necessary elements back in the view.

PD: I tried to use the same process with negative text indent, but I don't know why it didn't work.

Ricardo Castañeda
  • 5,746
  • 6
  • 28
  • 41
0
text-indent:-9999px;
position:relative;

for IE7:

text-transform:uppercase;
Luca
  • 9,259
  • 5
  • 46
  • 59
S.S.Niranga
  • 364
  • 1
  • 11