1

I'm working on a portfolio for a friend. The tiles for each portfolio item do not align properly, there is an odd space after the 3rd tile which causes the fourth item to stick out. This makes the 6th item not fit in.

Screenshot: enter image description here

Code:

  <!-- UX Works container -->
  <div id="work" class="container">
    <h2>UX Projects</h2>
    <ul class="work-images">
      <li> <!-- THREE ITEMS -->
        <div><a class="fancybox-thumb" rel="fancybox-thumb" href="interaction-design.html" title="Image 01"><img src="img/1-thumb.jpg"/></div>
        <div class="thumbnone">Wearable G-Scope Interaction Design project</div></a>
      </li>
      <li>
        <div><a class="fancybox-thumb" rel="fancybox-thumb" href="information-architecture.html"><img src="img/2-thumb.jpg" />
        </a>
        <div class="thumbnone">Information Architecture for Instant Noodles E-Store</div>
        </div>
      </li>
      <li>
        <div><a class="fancybox-thumb" rel="fancybox-thumb" href="research-critique.html"><img src="img/3-thumb.jpg" />
        </a>
        <div class="thumbnone">Review of CHI2014 paper Quantifying Visual Preferences </div></div>
      </li>
      <li> <!-- THREE ITEMS -->
        <div><a class="fancybox-thumb" rel="fancybox-thumb" href="requirements-engineering.html"><img src="img/3-1-thumb.jpg" />
        </a>
        <div class="thumbnone">Requirements modelling for Amazon Drone </div></div>
      </li> 
      <li>
        <div><a class="fancybox-thumb" rel="fancybox-thumb" href="inclusive-design.html"><img src="img/9-thumb.jpg" />
        </a>
        <div class="thumbnone">Inclusive design WCAG2.0 Poster </div></div>
      </li>
      <li>

EDIT** CSS - CODE:

/**** Work container *****/
ul.work-images li {
    list-style:none;
    display:inline-block;
    margin: 8px 10px;
    background:
}
ul.work-images li:first-child {
    margin-left:0;
}
ul.work-images li:second-child {
    margin-left:0;
}
ul.work-images li:third-child {
    margin-left:0;
}
ul.work-images li div {
    background:url(../img/eye.png) 50% 50% no-repeat;
    background-color: #f04949;
    -webkit-transition: all 0.2s linear;
    -moz-transition: all 0.2s linear;
    -o-transition: all 0.2s linear;
    transition: all 0.2s linear;
}
ul.work-images li img {
    -webkit-transition: all 0.2s linear;
    -moz-transition: all 0.2s linear;
    -o-transition: all 0.2s linear;
    transition: all 0.2s linear;
}
ul.work-images li img:hover {
    opacity:0.1;
}

Does anyone know what caused this?

  • 1
    look at this: http://stackoverflow.com/questions/241512/best-way-to-manage-whitespace-between-inline-list-items – caramba May 06 '15 at 23:36
  • I think its the `margin: 8px 10px;` causing that gap. Incidentally, there's no `:third-child`. You may want [`:nth-child(3)`](https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child). – showdev May 06 '15 at 23:59
  • But arent those margins for the images? – user3504462 May 07 '15 at 00:04
  • I mean the margin on the `
  • ` elements. But also, white space between the items will be displayed because they are `inline-block`, as mentioned by caramba.
  • – showdev May 07 '15 at 00:08
  • Possible duplicate of [Best way to manage whitespace between inline list items](https://stackoverflow.com/questions/241512/best-way-to-manage-whitespace-between-inline-list-items) – Rob Aug 31 '18 at 12:19