如何删除& nbsp;从跨度的结束与给定类? [英] How to remove   from the end of spans with a given class?
问题描述
我需要在给定范围的值之后删除& nbsp;
。
HTML如下所示:
I need to remove the
after the value of given spans.
The HTML looks like this:
<span class="number">0.15 </span>
来自服务器(CMS)。
The is coming from the server (CMS).
有任何方法删除& nbsp;通过使用CSS规则?
Is there any way to remove the by using CSS rules?
推荐答案
如果这个值是由CMS提供的,你可以通过php通过 str_replace('& nbsp;','',$ yourVar)
If this value is provided by your CMS, it's posible you can modify the value with php via str_replace(' ', '', $yourVar)
before echo it in your span.
如果你不能访问这个,你也可以使用jQuery来做到这一点...就像Muhammad Ali所说:
If you can't access with this, you can also use jQuery to do this... Just like Muhammad Ali said :
var str = $('.number').html();
str.replace(' ', '');
$('.number').html(str);
这样的东西可以工作。但是用CSS,是不可能的,我猜。
Something like this could work. But with CSS, isn't posible i guess.
这篇关于如何删除& nbsp;从跨度的结束与给定类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!