简体   繁体   English

如何使用css不显示

[英]how to do display none using css

<div class="span9">
<span class="disabled">&lt;&lt; previous</span><span class="current numbers">1</span> | 
    <span class="numbers"><a href="/index/page:2">2</a></span> | 
    <span class="numbers"><a href="/index/page:3">3</a></span>
<span class="next"><a href="/index/page:2" rel="next">next &gt;&gt;</a></span>

I want to delete ' | 我要删除' | ' sign after span . span后签字。 I am using cakephp pagination . 我正在使用cakephp分页 Is it possible to delete thought css or jquery or javascript . 是否可以删除思想cssjqueryjavascript Automatically its taking | 自动获取| sign from library pagination. 库分页的标志。

You can remove all the unwraped elements like this, 您可以删除所有这样的未包装元素,

$('.span9').html($('.span9').children());

Fiddle 小提琴

i think this is the easiest way to replace your | 我认为这是替换您的|最简单的方法。 in span text hopefully you may use this 跨度文本希望您可以使用此

 $(".span9").html($(".span9").html().split('|').join(""));

try this Fiddle 试试这个小提琴

I think a solution where the | 我认为解决方案在哪里| is replaced with 被替换为 is what you are looking for, then 是您想要的,然后

$('span.numbers').each(function(){
    var next = this.nextSibling;
    if(next && next.nodeType==3 && next.nodeValue.trim()=='|'){
        next.nodeValue = ' ';
        //or this.parentNode.removeChild(next);
    }
})

Demo: Fiddle 演示: 小提琴

You can set font-size to 0 of the div and add font-sizes to spans. 您可以将div的font-size设置为0并将字体大小添加到跨度。

div { font-size: 0px}
div span { font-size: 14px;padding: 3px;}

Fiddle 小提琴

You can hide the span9 and make the other spans visible. 您可以隐藏span9并使其他范围可见。

.span9 {
visibility: hidden;
}

.span9 span {
visibility: visible;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM