1 - Centrer une image verticalement et horizontalement
Le code :
#container {
max-height: 100%;
}
#container img {
/* Keeps image from going outside the screen */
max-height: 100%;
max-width: 100%;
/* Keeps image from beeing distorted */
height: auto;
width: auto;
/* centering horizontally AND vertically */
/* 50% of container */
position: relative;
top: 50%;
left: 50%;
/* 50% of image */
transform: translate(-50%,-50%);
}