Search code examples
htmltwitter-bootstrapthumbnails

Bootstrap Thumbnail Class Not Recognized


Whenever I try to invoke thumbnails per the twitter documentation, I just get black dots on the screen:

<ul class="thumbnails">
  <li class="span4">
    <a href="large.jpeg" class="thumbnail">
      <img data-src="http://placehold.it/330x230" alt="Large">
    </a>
  </li>

Am I doing something wrong here? I can only get something to show up using media-grid...which is strange since that's the old functionality, right?

EDIT: I still get black dots to the left of my thumbnails using media-grid, too. How do I turn those off, and why isn't the html I wrote working?

full code:

<html>
 <head>
         <meta charset="utf-8">
         <title>Walls</title>
         <link rel="stylesheet" href="http://flip.hr/css/bootstrap.min.css">
         <link rel="stylesheet" href="custo.css">

          <script src="js/jquery.js" type="text/javascript" charset="utf-8"></script> <!--prettyphotty-->
          <link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" media="screen" charset="utf-8" />
          <script src="js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>

 </head>
 <body>

 <br>



 <div class="container-fluid">
 <br>

 <ul class="media-grid">
  <li class="span4">
    <a href="super.jpg" rel="prettyPhoto">
      <img class="thumbnail" src="http://placehold.it/330x230" alt="">
    </a>
  </li>
  <li class="span4">
    <a href="super.jpg">
      <img class="thumbnail" src="http://placehold.it/330x230" alt="">
    </a>
  </li>
</ul>



<ul class="thumbnails">
  <li class="span4">
    <a href="large.jpeg" class="thumbnail">
      <img data-src="http://placehold.it/330x230" alt="Large">
    </a>
  </li>

  <li class="span4">
    <a href="#" class="thumbnail">
      <img data-src="holder.js/300x200" alt="">
    </a>
  </li>

  <li class="span4">
    <a href="#" class="thumbnail">
      <img data-src="holder.js/300x200" alt="">
    </a>
  </li>

</ul>



 </div><!-- .container -->

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>

    <script type="text/javascript" charset="utf-8"> <!--initialize prettyPhoto-->
     $(document).ready(function(){
     $("a[rel^='prettyPhoto']").prettyPhoto();
      });
    </script>

 </body>
</html>

Solution

  • The stylesheet you are referencing for Bootstrap http://flip.hr/css/bootstrap.min.css does not have the class for thumbnail defined.

    Once you are referencing a current version of Bootstrap, the correct structure would look something like the following (taken directly from: http://twitter.github.io/bootstrap/components.html#thumbnails):

    <ul class="thumbnails">
      <li class="span4">
        <a href="#" class="thumbnail">
          <img data-src="holder.js/300x200" alt="">
        </a>
      </li>
      ...
    </ul>
    

    Also, as of version 2...there is no media-grid class (taken from http://twitter.github.io/bootstrap/upgrading.html):

    Formerly .media-grid, now just .thumbnails, we've thoroughly extended this component for more uses while maintaining overall simplicity out of the box.