我有登錄表單,其中徽標位於頂部,整個表單位於屏幕中央。一切都很完美,但是當我在小型顯示器上試用時,如果此表單不適合垂直放置,則徽標會被裁剪,而我無法在其頂部滾動。如何在小顯示器的情況下保持居中圖像的滾動
Simplyfied例子是在這裏:
.login-form {
width: 250px;
background-color: #eee;
padding: 20px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.logo {
width: 100%;
}
.img-container {
margin-bottom: 20px;
}
.form-container {
text-align: center;
}
.button {
width: 80px;
}
input {
width: 200px;
margin-bottom: 10px;
}
<div class="login-form">
<div class="img-container">
<img src="https://pmcdeadline2.files.wordpress.com/2016/07/logo-tv-logo.png" alt="logo" class="logo">
</div>
<form class="form-container">
<input type="text" placeholder="Username">
<input type="password" placeholder="Password">
<button>Login</button>
</form>
</div>
我試圖定位是登錄表單還與柔性而不是變換翻譯,但具有相同的結果。任何人都可以幫我解決這個問題嗎?感謝您的任何建議。