17 lines
592 B
CSS
17 lines
592 B
CSS
.image-container {
|
|
margin-top: 10px;
|
|
margin-bottom: 10px;
|
|
width: 100%;
|
|
height: 20vh; /* Show 20% of the viewport height */
|
|
overflow: hidden; /* Hide parts of the image outside the container */
|
|
position: relative; /* Position context for the image */
|
|
}
|
|
|
|
.image-container img {
|
|
width: 100%; /* Make the image fit the container width */
|
|
height: auto; /* Maintain aspect ratio */
|
|
position: absolute; /* Position image relative to container */
|
|
top: 50%; /* Move image down by 50% of its height */
|
|
transform: translateY(-50%); /* Pull it back up by 50% of its own height */
|
|
}
|