Hey guys, I started with CSS3 and yeah I have a little problem while creating an Image Gallery ONLY in Css3.
Here are my files, index.html and style.css:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Unbenanntes Dokument</title>
</head>
<body>
<div id="content">
<ul>
<li class="gallerie"><a href="#"><img src="images/portfolio/new/img01.jpg" class="resize"/></a>
<div class="gallerie_popup"><a href="images/portfolio/new/img01.jpg"><img src="images/portfolio/new/img01.jpg" /></a>
</div></li>
<li class="gallerie"><a href="#"><img src="images/portfolio/new/img02.jpg" class="resize"/></a>
<div class="gallerie_popup"><a href="images/portfolio/new/img02.jpg"><img src="images/portfolio/new/img02.jpg" /></a>
</div></li>
<li class="gallerie"><a href="#"><img src="images/portfolio/new/img03.jpg" class="resize"/></a>
<div class="gallerie_popup"><a href="images/portfolio/new/img03.jpg"><img src="images/portfolio/new/img03.jpg" /></a>
</div></li>
<li class="gallerie"><a href="#"><img src="images/portfolio/new/img04.jpg" class="resize"/></a>
<div class="gallerie_popup"><a href="images/portfolio/new/img04.jpg"><img src="images/portfolio/new/img04.jpg" /></a>
</div></li>
<li class="gallerie"><a href="#"><img src="images/portfolio/new/img05.jpg" class="resize"/></a>
<div class="gallerie_popup"><a href="images/portfolio/new/img05.jpg"><img src="images/portfolio/new/img05.jpg" /></a>
</div></li>
<li class="gallerie"><a href="#"><img src="images/portfolio/new/img06.jpg" class="resize"/></a>
<div class="gallerie_popup"><a href="images/portfolio/new/img06.jpg"><img src="images/portfolio/new/img06.jpg" /></a>
</div></li>
</ul>
</div>
</body>
</html>
@charset "utf-8";
#content{
margin-top:50px;
}
#content img:hover {
padding:0;
margin:0px;
-moz-box-shadow: 2px 2px 2px #;
-webkit-box-shadow: 2px 2px 2px #;
box-shadow: 2px 2px 2px #;
-webkit-transform:scale(5);
-moz-transform: scale(5);
-o-transform:scale(5);
transform:scale(5);
position:relative;
z-index:2;
}
#content img {
padding-top:10px;
-webkit-transition: all 0.4s ease-out;
-moz-transition: all 0.4s ease-out;
-o-transition: all 0.4s ease-out;
transition: all 0.4s ease-out;
}
.box_01{
height:150px;
width:100px;
}
.box_02{
height:100px;
width:150px;
}
/*TEST*/
.resize{
width:120px;
height:125px;
border-color:#FFF;
border-bottom-width:30px;
border-left-width:10px;
border-right-width:10px;
border-top-width:10px;
border-style:solid;
-moz-box-shadow: 0 0 6px 1px #666666;
-webkit-box-shadow: 0 0 6px 1px #666666;
box-shadow: 0 0 6px 1px #666666;
}
.resize:hover{
-webkit-transform:scale(1.5);
-moz-transform:scale(1.5);
-o-transform:scale(1.5);
transform:scale(1.5);
-webkit-transition: all 0.5s ease-out;
-moz-transition: all 0.5s ease-out;
-o-transition: all 0.5s ease-out;
transition: all 0.5s ease-out;
}
a:target{
-webkit-transform:scale(10);
-moz-transform:scale(10);
-o-transform:scale(10);
transform:scale(10);
}
.gallerie{
position:relative !important;
display:inline-block;
}
.gallerie > .gallerie_popup{
display:none;
}
.gallerie > a:focus + .gallerie_popup
{
display:block;
}
.gallerie_popup{
background: -moz-linear-gradient(top, rgba(51,51,51,0.85) 0%, rgba(0,0,0,0.85) 100%);
background: linear-gradient(top, rgba(51,51,51,0.85) 0%, rgba(0,0,0,0.85) 100%);
-pie-background: linear-gradient(top, rgba(51,51,51,0.25) 0%, rgba(0,0,0,0.25) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(51,51,51,0.85)), color-stop(100%,rgba(0,0,0,0.85)));
-moz-box-shadow: 0 0 6px 1px #666666;
-webkit-box-shadow: 0 0 6px 1px #666666;
box-shadow: 0 0 6px 1px #666666;
border:solid #FFFFFF;
color: #E7E7E7;
min-width:200px;
padding: 5px;
position:absolute;
z-index: 10;
}
li{
margin-right:-5px;
}
Now I want, that the Image is centered when I press on it. I can change the position with for example(the last line):
.gallerie_popup{
background: -moz-linear-gradient(top, rgba(51,51,51,0.85) 0%, rgba(0,0,0,0.85) 100%);
background: linear-gradient(top, rgba(51,51,51,0.85) 0%, rgba(0,0,0,0.85) 100%);
-pie-background: linear-gradient(top, rgba(51,51,51,0.25) 0%, rgba(0,0,0,0.25) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(51,51,51,0.85)), color-stop(100%,rgba(0,0,0,0.85)));
-moz-box-shadow: 0 0 6px 1px #666666;
-webkit-box-shadow: 0 0 6px 1px #666666;
box-shadow: 0 0 6px 1px #666666;
border:solid #FFFFFF;
color: #E7E7E7;
min-width:200px;
padding: 5px;
position:absolute;
z-index: 10;
/*#####HERE#####*/left:-50px;/*#####HERE#####*
}
But I can't center images and with margin:0 auto; or transform-origin:center; it doesen't work.