-2

I have a test page here: http://desertcinema.com/home-test/

I added an inline display: none; on one of the <li> here and I expected to get a result like this by default: See image:

enter image description here

However, I don't know what happened but it actually leaves a blank space, like the image below:

enter image description here

I am wondering if how I can hide that list item without having that blank space there. Here's what my code looks like:

<ul class="portfolio-wrap">
    <li class="portfolio-box photography "> 
        <a class="gallery" rel="gallery2" href="http://desertcinema.com/wp-content/uploads/bfi_thumb/SKRE-9-30sp4bav1hxsgwj54nvaww.jpg" title="Concealment">
            <img src="http://desertcinema.com/wp-content/uploads/bfi_thumb/SKRE-9-30sp4baun93pvbri4pf1ts.jpg" alt="" /> 
            <div class="mask"></div>
            <div class="line-folio"></div>
            <div class="line-folio1"></div>
            <h4>Concealment</h4>
        </a>
    </li>
    <li class="portfolio-box photography" style="display: none;"> 
        <a class="gallery" rel="gallery2" href="http://desertcinema.com/wp-content/uploads/bfi_thumb/Mike-Full-Draw-30sp495yqivl82ubkxq5mo.jpg" title="Concealment">
            <img src="http://desertcinema.com/wp-content/uploads/bfi_thumb/SKRE-9-30sp4baun93pvbri4pf1ts.jpg" alt="" /> 
                <div class="mask"></div>
                <div class="line-folio"></div>
                <div class="line-folio1"></div>
                <h4>Concealment</h4>
           </a>
    </li>
</ul>

Any idea what I'm missing out? How can I hide an item without getting a blank space?

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
Kimberly Wright
  • 521
  • 8
  • 22
  • If you don't want it displayed, why include it at all? Swap it for a different IMG, or do a display: none on hover – Rachel Gallen Jun 27 '16 at 09:49
  • @NooBskie: nope. I just need to hide it. I am using fancybox to hide that element but that image it will show up on the gallery.under one category – Kimberly Wright Jun 27 '16 at 09:49
  • 2
    the positions are precalculated, with some plugins, the translate3d shows this. I think the easiest solution is to remove the item from your list. –  Jun 27 '16 at 09:50
  • @RachelGallen: The reason why I am not taking it out is that it will show up the image on the popout (via fancybox plugin) so I just need to hide it but havign that issue of blank space. – Kimberly Wright Jun 27 '16 at 09:50
  • @PaulJohnDiwa: As much as I would like too I can't.The reason why I am not taking it out is that it will show up the image on the popout (via fancybox plugin) so I just need to hide it but havign that issue of blank space. – Kimberly Wright Jun 27 '16 at 09:51
  • @KimberleyWright the white space is not an 'issue', it's what's supposed to happen when you display:none, I.e. expected behaviour, I don't know why you expected otherwise. – Rachel Gallen Jun 27 '16 at 09:54
  • okay here you go, .portfolio-wrap.isotope > li:last-child{ transform: translate3d(1000px,0px,0px) !important –  Jun 27 '16 at 09:54
  • removing that list item from DOM do the trick, the library you are using is accountable for that hidden list too. remove that list from DOM and again fire the event. would be better if you read the provided properties of that library – Anil Tiwari Jun 27 '16 at 09:56
  • *you can inspect element to see the codes on the next items"* - no, I can't access your (temporary?) test site, that's why *all relevant* code should be included in the question. Maybe recreate in a fiddle. Read this [mvce]. – freedomn-m Jun 27 '16 at 09:59
  • you can paste my answer on the console, maybe you can get the idea on how you could resolve this –  Jun 27 '16 at 10:06
  • @PaulJohnDiwa: Can't seem grasp the idea yet. Can we move this on chat? – Kimberly Wright Jun 27 '16 at 10:15
  • @KimberlyWright. check my answer i think that's what you want :) – M.Tanzil Jun 27 '16 at 10:47