Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Basics (2014) Enhancing the Design With CSS Box Shadows

Box shadow detrimentally alters img

I'm doing a personal website after the "How To Make A Website" model? My images are nothing but different colored boxes created in Microsoft Paint. When I use the box shadow property for my images a white line appears on the bottom of the images. When I comment out the box shadow property the white line disappears.

HTML

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="css/normalize.css">
    <link href='https://fonts.googleapis.com/css?family=Poiret+One|Tangerine' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" href="css/style.css">
    <title>Designer</title>
  </head>
  <body>
    <header>
      <a href="index.html" id="logo">
        <h1>Digital Designer <br><span id="subtitle">A Visual Collection</span></h1>
      </a>
      <nav>
        <ul id="sitenav">
          <li><a href="index.html">Main Design</a></li>
          <li><a href="static.html">Static</a></li>
          <li><a href="dynamic.html">Dynamic</a></li>
          <li><a href="about.html">About</a></li>
        </ul>
      </nav>
    </header>
    <div id="showcase">
      <section>
        <ul id="gallery">
          <li><img src="img/img1.png" alt="One"></li>
          <li><img src="img/img2.png" alt="Two"></li>
          <li><img src="img/img3.png" alt="Three"></li>
          <li><img src="img/img4.png" alt="Four"></li>
          <li><img src="img/img5.png" alt="Five"></li>
          <li><img src="img/img6.png" alt="Six"></li>
          <li><img src="img/img7.png" alt="Seven"></li>
          <li><img src="img/img8.png" alt="Eight"></li>
          <li><img src="img/img9.png" alt="Nine"></li>
      </section>
      <footer>
        <p>&copy 2016 Benjamin Hedgepeth.</p>
      </footer>
    </div>
  </body>
</html>

CSS

#showcase #gallery li {
  box-shadow: 0 8px 10px -5px black;
}

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Well, I see a couple of interesting things here. First off, your unordered list is never terminated. You're missing the ending tag for it. Secondly I believe your CSS rule should look like this:

#showcase,
 #gallery li {
  box-shadow: 0 8px 10px -5px black;
}

You might try to remove the #showcase part from that line altogether.

I fixed the unordered list by inserting the closing tag and I removed the #showcase yet I still have the same problem.

Adam Hill
Adam Hill
7,492 Points

You can sometimes get hangovers from native browser default styles, you could try adding padding:0; and line-height:0; to your #gallery li style.