CSS image gallery
by thebabydino
HTML
<div id="outer-wrapper" class="rounded-corners">
<ul id="wrapper">
<li class="rounded-corners">
<div class="image-wrapper">
<img src="http://img511.imageshack.us/img511/8963/blackchococakexxsmall.jpg" alt="Black"/>
<p class="info">Cocoa cake with dark chocolate cream and chocolate decoration.</p>
</div>
<h4>Black</h4>
</li>
<li class="rounded-corners">
<div class="image-wrapper">
<img src="http://img412.imageshack.us/img412/7626/blackforesticecreamxxsm.jpg" alt="Black Forest"/>
<p class="info">Black Forest ice-cream.</p>
</div>
<h4>Black Forest</h4>
</li>
<li class="rounded-corners">
<div class="image-wrapper">
<img src="http://img401.imageshack.us/img401/6011/butterflychocowcherryli.jpg" alt="Butterfly"/>
<p class="info">Delicious chocolate cake with "drunken" cherries, chocolate syrup, whipped cream and a chocolate butterfly on top.</p>
</div>
<h4>Butterfly</h4>
</li>
<li class="rounded-corners">
<div class="image-wrapper">
<img src="http://img508.imageshack.us/img508/16/chocolatinexxsmall.jpg" alt="Chocolatine"/>
<p class="info">Cocoa cake with cocoa cream, whipped cream and chocolate decoration on top.</p>
</div>
<h4>Chocolatine</h4>
</li>
<li class="rounded-corners">
<div class="image-wrapper">
<img src="http://img24.imageshack.us/img24/4968/kprofiterolexxsmall.jpg" alt="Kaola Profiterole"/>
<p class="info">Some kind of profiterole with various kinds of chocolate mousse.</p>
</div>
<h4>Kaola Profiterole</h4>
</li>
<li class="rounded-corners">
<div class="image-wrapper">
<img...
CSS
ul, li, img, div, p, h4 {
margin: 0;
padding:0;
position:relative;
}
body {
background-color: #ccc;
font-family: Trebuchet MS, sans-serif;
}
.rounded-corners {
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-khtml-border-radius: 10px;
border-radius: 10px;
}
#outer-wrapper {
width: 90%;
min-width: 380px;
margin: 0 auto;
padding: 10px 0 10px 10px;
border: solid 2px black;
-webkit-box-shadow: inset -2px 2px 3px 191919;
-moz-box-shadow: inset -2px 2px 3px 191919;
box-shadow: inset -2px 2px 3px 191919;
overflow: hidden;
background-color:#aaa;
}
#wrapper {
width: 7000px;
height: 280px;
list-style: none;
}
li {
margin-right: -320px;
padding: 8px;
-moz-box-shadow: -3px 3px 3px #191919;
-webkit-box-shadow: -3px 3px 3px #191919;
box-shadow: -3px 3px 3px #191919;
border: solid 1px #000\9;
*border: solid 1px #000;
float: left;
background-color: #ccc;
-webkit-transition: all 2.5s ease-in-out;
-moz-transition: all 2.5s ease-in-out;
-o-transition: all 2.5s ease-in-out;
transition: all 2.5s ease-in-out;
}
li:hover {
margin-right: -13px;
}
li:last-child, li.last-child, li:last-child:hover, li.last-child:hover {
margin: 0;
}
.image-wrapper {
width: 320px;
height: 240px;
overflow: hidden;
}
.info {
bottom: 0;
width: 300px;
padding: 2px 10px;
position: absolute;
background-color: transparent;
color: transparent;
font-size: 14px;
-webkit-transition: all 2.5s ease-in-out;
-moz-transition: all 2.5s ease-in-out;
-o-transition: all 2.5s ease-in-out;
transition: all 2.5s ease-in-out;
}
.image-wrapper:hover .info {
background-color: rgba(0,0,0,.7);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#99000000', EndColorStr='#99000000');
color: white;
}
h4 {
cursor: default;
}