Note that there are some explanatory texts on larger screens.

plurals
  1. POthumbnail gallery not fitting images side by side
    primarykey
    data
    text
    <p>I am using a class called galleryItem to group thumbnail images together with a title and then I am using Lightbox as a gallery to view the images.</p> <p>My problem is getting the images to stay side by side. </p> <p>here's my html:</p> <pre><code>&lt;div class="contents"&gt; &lt;div class="galleryItem"&gt; &lt;a href="img/watermelon.jpg" rel="lightbox[menu]"&gt;&lt;img src="img/watermelon.jpg" title="Vanilla" alt="Watermelon" width="90px" height="110px"&gt;&lt;/a&gt; &lt;p.smallText&gt;Vanilla&lt;/p&gt; &lt;/div&gt; &lt;div class="galleryItem"&gt; &lt;a href="img/strawberry.jpg"rel="lightbox[menu]"&gt;&lt;img src="img/strawberry.jpg" alt="Watermelon" width="90px" height="110px" &gt;&lt;/a&gt; &lt;p.smallText&gt;Chocolate&lt;/p&gt; &lt;/div&gt; &lt;div class="galleryItem"&gt; &lt;a href="img/watermelon.jpg"rel="lightbox[menu]"&gt;&lt;img src="img/chips.jpg" alt="Watermelon" width="90px" height="110px" &gt;&lt;/a&gt; &lt;p.smallText&gt;Strawberry Sorbet&lt;/p&gt; &lt;/div&gt; &lt;div class="galleryItem"&gt; &lt;a href="img/chips.jpg"rel="lightbox[menu]"&gt;&lt;img src="img/strawberry.jpg" alt="Watermelon" width="90px" height="110px" &gt;&lt;/a&gt; &lt;p.smallText&gt;Roasted Strawberry&lt;/p&gt; &lt;/div&gt; &lt;div class="galleryItem"&gt; &lt;a href="img/assortment.jpg"rel="lightbox[menu]"&gt;&lt;img src="img/watermelon.jpg" alt="Watermelon" width="90px" height="110px"&gt;&lt;/a&gt; &lt;p.smallText&gt;Whiskey Pecan&lt;/p&gt; &lt;/div&gt; &lt;div class="galleryItem"&gt; &lt;a href="img/watermelon.jpg"rel="lightbox[menu]"&gt;&lt;img src="img/watermelon.jpg" alt="Watermelon"&gt;&lt;/a&gt; &lt;p.smallText&gt;Pomegranate Sorbet&lt;/p&gt; &lt;/div&gt; &lt;div class="galleryItem"&gt; &lt;a href="img/watermelon.jpg"rel="lightbox[menu]"&gt;&lt;img src="img/watermelon.jpg" alt="Watermelon"&gt;&lt;/a&gt; &lt;p.smallText&gt;Salty Caramel&lt;/p&gt; &lt;/div&gt; &lt;div class="galleryItem"&gt; &lt;a href="img/watermelon.jpg"rel="lightbox[menu]"&gt;&lt;img src="img/watermelon.jpg" alt="Watermelon"&gt;&lt;/a&gt; &lt;p.smallText&gt;Mint Chip&lt;/p&gt; &lt;/div&gt; &lt;div class="galleryItem"&gt; &lt;a href="img/watermelon.jpg"rel="lightbox[menu]"&gt;&lt;img src="img/watermelon.jpg" alt="Watermelon"&gt;&lt;/a&gt; &lt;p.smallText&gt;Peanut Butter Chip&lt;/p&gt; &lt;/div&gt; &lt;div class="galleryItem"&gt; &lt;a href="img/watermelon.jpg"rel="lightbox[menu]"&gt;&lt;img src="img/watermelon.jpg" alt="Watermelon"&gt;&lt;/a&gt; &lt;p.smallText&gt;Nutella&lt;/p&gt; &lt;/div&gt; &lt;div class="galleryItem"&gt; &lt;a href="#"rel="lightbox[menu]"&gt;&lt;img src="img/watermelon.jpg" alt="Watermelon"&gt;&lt;/a&gt; &lt;p.smallText&gt;Mango Sorbet&lt;/p&gt; &lt;/div&gt; &lt;div class="galleryItem"&gt; &lt;a href="#"rel="lightbox[menu]"&gt;&lt;img src="img/watermelon.jpg" alt="Watermelon"&gt;&lt;/a&gt; &lt;p.smallText&gt;Raspberry Lemon Yogurt&lt;/p&gt; &lt;/div&gt; &lt;div class="galleryItem"&gt; &lt;a href="#"rel="lightbox[menu]"&gt;&lt;img src="img/watermelon.jpg" alt="Watermelon"&gt;&lt;/a&gt; &lt;p.smallText&gt;Cookies and Cream&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;!--end contents --&gt; </code></pre> <p>here's my css:</p> <pre><code>.contents { width: 80%; margin: 20px auto; overflow: hidden; } .galleryItem { color: #797478; font: 10px/1.5 Verdana, Helvetica, sans-serif; float: left; width: 16%; margin: 2% 2% 80px 2%; } .galleryItem h3 { text-transform: uppercase; } .galleryItem img { max-width: 100%; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .galleryItem img:hover { opacity:0.4; filter:alpha(opacity=40); /* For IE8 and earlier */ } .galleryItem h3:hover {text-size:large; color:rgb(128, 0, 0);} /* MEDIA QUERIES*/ @media only screen and (max-width : 940px), only screen and (max-device-width : 940px){ .galleryItem {width: 21%;} } @media only screen and (max-width : 720px), only screen and (max-device-width : 720px){ .galleryItem {width: 29.33333%;} } @media only screen and (max-width : 530px), only screen and (max-device-width : 530px){ .galleryItem {width: 46%;} } @media only screen and (max-width : 320px), only screen and (max-device-width : 320px){ .galleryItem {width: 96%;} .galleryItem img {width: 96%;} .galleryItem h3 {font-size: 18px;} .galleryItem p, {font-size: 18px;} } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload