I have centered my div ui-content
to the middle of my page on a resolution of 1920x1080
, but when I check it on a resolution of 1366x768
the div doesn't adjust itself for a lower height. On the 1920x1080 resolution, when I resize the height I have the exact same problem. I would have expected it resize to something smaller, as it does with the background image.
I tried working with the atrribute max-height
, but that just adds a scroll bar and does nothing. I also tried Oliviers suggestion, but that didn't seem to do anything either. I created a JSFiddle with the full code here and added the relevant css code below.
element.style {
margin-bottom: 30px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.ui-content {
padding-top: .5em;
max-width: 768px;
margin: 0 auto;
background-color: rgba(19, 23, 23, 0.38);
border-radius: 26px;
}