Thumbnails not displaying properly at the end of Chapter 5

Hello, my thumbnails look like this:

I have checked the CSS and HTML and it looks correct. They are pasted below. Any ideas? Thanks!

@font-face {
  font-family: 'airstreamregular';
  font-style: normal;
  font-weight: normal;
  src: url("fonts/Airstream-webfont.eot");
  src: url('fonts/Airstream-webfont.eot?#iefix') format('embedded-opentype'),
       url('fonts/Airstream-webfont.woff') format('woff'),
       url('fonts/Airstream-webfont.ttf') format('truetype'),
       url('fonts/Airstream-webfont.svg#lakeshore') format('svg');
}

@font-face {
  font-family: 'lakeshore';
  font-style: normal;
  font-weight: normal;
  src: url('fonts/LAKESHOR-webfont.eot');
  src: url('fonts/LAKESHOR-webfont.eot?#iefix') format('embedded-opentype'),
       url('fonts/LAKESHOR-webfont.woff') format('woff'),
       url('fonts/LAKESHOR-webfont.ttf') format('truetype'),
       url('fonts/LAKESHOR-webfont.svg#lakeshore') format('svg');
}

html, body {
  height: 100%;
}

body {
  background: rgb(149, 194, 215);
  display: flex;
  flex-direction: column;
  font-size: 10px;
}

a[href="#"] {
  text-decoration: none;
}

.logo-text {
  background: white;
  font-family: lakeshore;
  font-size: 37px;
  text-align: center;
  text-transform: uppercase;
}

.main-header {
  flex: 0 1 auto;
}

.main-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.detail-image {
  width: 90%;
}

.detail-image-container {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.detail-image-frame {
  position: relative;
  text-align: center;
}

.detail-image-title {
  color: white;
  font-family: airstreamregular;
  font-size: 40px;
  position: absolute;
  bottom: -16px;
  left: 4px;
  text-shadow: rgba(0, 0, 0, 0.9) 1px 2px 9px;
}

.thumbnail-image {
  display: block;
  width: 100%;
}

.thumbnail-item {
  border: 1px solid rgb(100%, 100%, 100%);
  border: 1px solid rgba(100%, 100%, 100%, 0.8);
  display: inline-block;
  min-height: 120px;
  min-width: 120px;
}

.thumbnail-list {
  display: flex;
  flex: 0 1 auto;
  justify-content: space-between;
  list-style: none;
  order: 2;

  overflow-x: auto;
  padding: 0;
  white-space: nowrap;
}

.thumbnail-title {
  background: rgb(96, 125, 139);
  color: rgb(202, 238, 255);
  display: block;
  font-size: 18px;
  margin: 0;
  padding: 4px 10px;
}

@media all and (min-width: 768px) {
  .main-content {
    flex-direction: row;
    overflow: hidden;
  }

  .thumbnail-list {
    flex-direction: column;
    margin-left: 20px;
    order: 0;
  }

  .thumbnail-item {
    max-width: 260px;
  }

  /* every item EXCEPT the first */
  .thumbnail-item + .thumbnail-item {
    margin-top: 20px;
  }
}

<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>ottergram</title>
    <link rel="stylesheet" href="stylesheets/styles.css">
  </head>

  <body>
    <header class="main-header">
      <h1 class="logo-text">ottergram</h1>
    </header>
    <main class="main-content">
      <ul class="thumbnail-list">
        <li class="thumbnail-item">
          <a href="#">
            <img class="thumbnail-image" src="img/otter1.jpg" alt="Barry the Otter">
            <span class="thumbnail-title">Barry</span>
          </a>
        </li>
        <li class="thumbnail-item">
          <a href="#">
            <img class="thumbnail-image" src="img/otter2.jpg" alt="Mohammed the Otter">
            <span class="thumbnail-title">Mohammed</span>
          </a>
        </li>
        <li class="thumbnail-item">
          <a href="#">
            <img class="thumbnail-image" src="img/otter3.jpg" alt="Grace the Otter">
            <span class="thumbnail-title">Grace</span>
          </a>
        </li>
        <li class="thumbnail-item">
          <a href="#">
            <img class="thumbnail-image" src="img/otter4.jpg" alt="Deon the Otter">
            <span class="thumbnail-title">Deon</span>
          </a>
        </li>
        <li class="thumbnail-item">
          <a href="#">
            <img class="thumbnail-image" src="img/otter5.jpg" alt="Aleesha the Otter">
            <span class="thumbnail-title">Aleesha</span>
          </a>
        </li>
        <li class="thumbnail-item">
          <a href="#">
            <img class="thumbnail-image" src="img/otter1.jpg" alt="Barry the Otter">
            <span class="thumbnail-title">Barry</span>
          </a>
        </li>
        <li class="thumbnail-item">
          <a href="#">
            <img class="thumbnail-image" src="img/otter2.jpg" alt="Mohammed the Otter">
            <span class="thumbnail-title">Mohammed</span>
          </a>
        </li>
        <li class="thumbnail-item">
          <a href="#">
            <img class="thumbnail-image" src="img/otter3.jpg" alt="Grace the Otter">
            <span class="thumbnail-title">Grace</span>
          </a>
        </li>
        <li class="thumbnail-item">
          <a href="#">
            <img class="thumbnail-image" src="img/otter4.jpg" alt="Deon the Otter">
            <span class="thumbnail-title">Deon</span>
          </a>
        </li>
        <li class="thumbnail-item">
          <a href="#">
            <img class="thumbnail-image" src="img/otter5.jpg" alt="Aleesha the Otter">
            <span class="thumbnail-title">Aleesha</span>
          </a>
        </li>
      </ul>

      <div class="detail-image-container">
        <div class="detail-image-frame">
          <img class="detail-image" src="img/otter1.jpg" alt="">
          <span class="detail-image-title">Stayin' Alive</span>
        </div>
      </div>
    </main>

  </body>
</html>

Hey,

Adding padding: 0 35px to .thumbnail-list in @media should fix it.

@media all and (min-width: 768px) {
   .thumbnail-list {
    flex-direction: column;
    margin-left: 20px;
    order: 0;
    padding: 0 35px;
  }
1 Like

Actually, your first answer fixed it (before you edited it)! I was not careful enough when reading the book.

  min-height: 120px;
  min-width: 120px;

should have been

  max-width: 120px;
  min-width: 120px;

It now looks perfect, thank you!!!

If you don’t mind answering, why is this different from just setting:

  width: 120px;
1 Like

I’ve changed my answer, because, unfortunately, couldn’t reproduce your issue by changing min-height to max-width.
Deleting padding, on the other hand, made my Ottegram look exactly like yours on the screenshot.

Anyway, happy to help :wink:

width is a hard value, if you resize your window, image will always stay the same width.
max-width will change depending on the window size.
max-width and min-width should be equal to just width actually.