Ensure media always maintains aspect ratio during manual resize
Add max-width/height constraints and object-position to guarantee aspect ratio is preserved when user manually resizes the window
This commit is contained in:
parent
45ebe5c0ae
commit
55fe55041f
1 changed files with 9 additions and 1 deletions
|
|
@ -24,12 +24,20 @@
|
|||
position: relative;
|
||||
}
|
||||
|
||||
/* Media element styles */
|
||||
/* Media element styles - always maintain aspect ratio */
|
||||
#media {
|
||||
grid-area: media;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
object-position: center;
|
||||
}
|
||||
|
||||
/* For images, ensure aspect ratio is preserved */
|
||||
img#media {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Player controls overlay */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue