简体   繁体   中英

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 . I am using cakephp pagination . Is it possible to delete thought css or jquery or javascript . 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: 0px}
div span { font-size: 14px;padding: 3px;}

Fiddle

You can hide the span9 and make the other spans visible.

.span9 {
visibility: hidden;
}

.span9 span {
visibility: visible;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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