Beispiel:CSS-Anw-Bildergalerie-2.html

Aus SELFHTML-Wiki
Wechseln zu: Navigation, Suche
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0;" />
  <link rel="stylesheet" media="screen" href="./Beispiel:SELFHTML-Beispiel-Grundlayout.css" />
  <style>
/* Mobile first - für schmale Viewports */
ul,li {
	margin: 0.1em;
	padding: 0.1em;
}
 
li {
    display: inline-block;	
	list-style-type: none;
	width: 45%;
}
 
img {
  padding: 0;
  margin: 0;	
  width: 100%;  /* Bild passt sich an verfügbaren Raum im li ann */
}
 
button {
  padding: 0.1em;
}
 
 
     /* Large screens */
@media all and (min-width: 35em) {
	li {
		width: 10em;
	}
 
	button {
		padding: 0.1em;
		width: 10em;
		height: 7.5em;
		position: relative;	
	}
 
	button img {
		border: 0;
		position: absolute;
		left: 0%;
		top: 0%;
		z-index: 1;
		box-shadow: 0;
		width: 10em;		
		transition: all 1s;			
	}
 
	button:focus img, 
	button:hover img {
		border: 2em solid #eee;
		border-radius: 1em;
		position: absolute;
		left: -4%;
		top: -4%;
		width: 300%;
		z-index: 5;
		box-shadow:1px 1px 5px #333;
		transition: all 1s;		
	}	
}
 
  </style>
  <title>Bildergalerie - 2</title>
</head>
 
<body>
  <h1>Bildergalerie - 2</h1>
 
  <main>
	<ul id="galerie">
		<li><button tabindex="1"><img src="//wiki.selfhtml.org/images/8/80/Dummy-1.jpg" alt="Spaß in der Sonne"></button></li>
		<li><button tabindex="1"><img src="//wiki.selfhtml.org/images/e/e7/Dummy-2.jpg" alt="Berg im Morgennebel"></button></li>
		<li><button tabindex="1"><img src="//wiki.selfhtml.org/images/c/c9/Dummy-3.jpg" alt="Spaß in der Sonne"></button></li>
		<li><button tabindex="1"><img src="//wiki.selfhtml.org/images/8/8e/Dummy-4.jpg" alt="Korallenriff"></button></li>
		<li><button tabindex="1"><img src="//wiki.selfhtml.org/images/1/1c/Dummy-5.jpg" alt="Morgensonne in Salo, Gardasee"></button></li>
		<li><button tabindex="1"><img src="//wiki.selfhtml.org/images/6/61/Dummy-6.jpg" alt="Via Appia, Rom"></button></li>    
        </ul>        
</main>
</body>
</html>