Я сталкиваюсь с проблемой в заголовке: < /p>
Когда я нажимаю на значок профиля, боковая панель (панель профиля) открывается. < /p>
На рабочем стопе: все работает Правильно. < /p>
Когда я нажимаю на одно из полей ввода (электронная почта или пароль), появляется мобильная клавиатура. < /p>
Сдвига боковой панели /частично исчезает - она выглядит как легкая прокрутка или сдвиг макета. Клавиатура, страница остается немного увеличенной. это. < /p>
Поядь мобильной клавиатуры может вызвать ее - как вы знаете, на мобильном телефоне. Клавиатура появляется только при нажатии на вход. Сдвиг).
Сфокусированный ввод остается видимым над клавиатурой.
Я открыт для решений CSS или JavaScript (добавление или удаление кода).
Живой веб -сайт для воспроизведения
Вы можете проверить это непосредственно:
https. /> Экриншоты
Перед нажатием ввода - боковая панель выглядит нормально .:
Введите описание изображения здесь < /p>
После нажатия ввода - боковой панели частично скрыта /сдвига. /> Введите описание изображения здесь < /p>
Код заголовка (html, css, js): < /p>
">" snippet-code-html lang-html prettyprint-overprintride ">"
Код: Выделить всё
/* Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Helvetica Neue', sans-serif;
padding-top: 70px; /* pour compenser le header fixe */
}
header {
background-color: white;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 1002;
margin-top : 25px;
}
.navbar {
max-width: 1200px;
margin: auto;
display: flex;
align-items: center;
justify-content: space-between;
padding: 15px 20px;
}
.logo {
font-size: 22px;
font-weight: bold;
text-transform: uppercase;
}
.nav-left,
.nav-right {
display: flex;
align-items: center;
gap: 20px;
}
.nav-icon {
background: none;
border: none;
font-size: 18px;
cursor: pointer;
}
.cart-count {
background: black;
color: white;
font-size: 12px;
padding: 2px 6px;
border-radius: 999px;
position: relative;
top: -10px;
left: -10px;
}
/* Fullscreen Search Box */
.search-box {
display: none;
position: fixed;
top: 70px;
left: 0;
right: 0;
bottom: 0;
background: white;
z-index: 1001;
padding: 40px 20px;
overflow-y: auto;
}
.search-box.active {
display: block;
}
.search-box form {
max-width: 600px;
margin: 0 auto 30px;
}
.search-box input[type="text"] {
width: 100%;
padding: 12px;
border: 1px solid #ddd;
font-size: 16px;
}
.search-box .close-search {
position: absolute;
top: 20px;
right: 30px;
font-size: 28px;
background: none;
border: none;
cursor: pointer;
}
.search-box h3 {
text-align: center;
margin-bottom: 30px;
font-size: 20px;
font-weight: 500;
}
.search-box .product-suggestions {
max-width: 1200px;
margin: 0 auto;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
}
.search-box .column {
display: flex;
flex-direction: column;
gap: 12px;
}
.search-box .product {
border: 1px solid #eee;
padding: 8px;
background: #fafafa;
}
.search-box .product a {
display: flex;
align-items: center;
gap: 10px;
text-decoration: none;
color: inherit;
}
.search-box .product img {
width: 50px;
height: 50px;
object-fit: contain;
}
.search-box .product h4 {
font-size: 12px;
margin: 0;
line-height: 1.2;
}
/* Sidebar */
.sidebar {
position: fixed;
top: 0;
left: -300px;
width: 260px;
height: 100%;
background: #f8f8f8;
transition: left 0.3s ease;
padding: 20px;
z-index: 999;
}
.sidebar.active {
left: 0;
}
.sidebar h3 {
margin-bottom: 15px;
}
.sidebar ul {
list-style: none;
}
.sidebar ul li {
margin: 10px 0;
}
/* Overlay */
.overlay {
display: none;
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.4);
z-index: 998;
}
.overlay.active {
display: block;
}
/* Profile Sidebar */
.profile-sidebar {
position: fixed;
top: 0;
right: -600px; /* correspond à la valeur de width */
width: 600px;
height: 100%;
background: #fff;
box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
padding: 20px;
z-index: 9999;
transition: right 0.3s ease;
}
@media (max-width: 768px) {
input,
textarea,
select {
font-size: 16px !important;
}
}
.profile-sidebar.active {
right: 0;
}
.profile-sidebar .close-btn {
background: none;
border: none;
font-size: 20px;
position: absolute;
top: 15px;
right: 15px;
cursor: pointer;
}
.profile-sidebar h2 {
margin-top: 40px;
font-size: 22px;
}
.profile-sidebar form {
display: flex;
flex-direction: column;
}
.profile-sidebar input {
margin-bottom: 15px;
padding: 10px;
border: 1px solid #ccc;
}
.profile-sidebar button[type='submit'] {
background: black;
color: white;
border: none;
padding: 10px;
cursor: pointer;
}
.register-btn {
display: inline-block;
background-color: black;
color: white;
padding: 10px 20px;
border-radius: 4px;
text-decoration: none;
font-weight: 500;
margin: 20px auto 10px;
}
.tabs {
display: flex;
justify-content: space-around;
border-bottom: 1px solid #ccc; /* fond gris */
margin-bottom: 20px;
}
.tabs-separator {
width: 60%; /* largeur du trait */
margin: 0 auto 10px; /* centré et espacement */
border: none;
border-top: 1px solid #ccc;
}
.tabs button {
flex: 1;
padding: 10px 0;
background: none;
border: none;
font-size: 16px;
cursor: pointer;
color: grey;
position: relative;
}
.tabs button.active {
color: black;
}
.tabs button.active::after {
content: "";
position: absolute;
bottom: -1px;
left: 50%;
transform: translateX(-50%);
width: 50px; /* largeur du trait noir */
height: 1px; /* épaisseur */
background-color: black;
border-radius: 2px;
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
text-align : center;
}
.topbar {
background-color: black;
color: white;
font-size: 14px;
height: 35px;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1003;
}
.topbar-message-container {
height: 100%;
overflow: hidden;
}
.topbar-messages {
list-style: none;
padding: 0;
margin: 0;
animation: slideMessages 24s steps(3) infinite;
}
.floating-label {
position: relative;
margin-bottom: 15px;
}
.floating-label input {
width: 100%;
padding: 10px 8px;
font-size: 14px;
border: 1px solid #ccc;
border-radius: 4px;
outline: none;
background: none;
}
.floating-label label {
position: absolute;
top: 50%;
left: 8px;
transform: translateY(-50%);
font-size: 14px;
color: #777;
pointer-events: none;
transition: 0.2s ease all;
background: white;
padding: 0 4px;
}
.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
top: -8px;
left: 6px;
font-size: 12px;
color: #333;
}
.topbar-messages li {
height: 35px;
display: flex;
align-items: center;
justify-content: center;
white-space: nowrap;
}
@keyframes slideMessages {
0% { transform: translateY(0%); }
33.333% { transform: translateY(-100%); }
66.666% { transform: translateY(-200%); }
}
body {
font-family: 'Helvetica Neue', sans-serif;
padding-top: 105px; /* 35px topbar + 70px header */
}
@media (max-width: 767px) {
.profile-sidebar {
width: 100vw;
right: -100vw;
padding: 20px;
}
.profile-sidebar.active {
right: 0;
}
}
@media (max-width: 767px) {
.sidebar {
width: 100vw;
left: -100vw;
padding: 20px;
}
.sidebar.active {
left: 0;
}
}
.profile-sidebar.active {
overflow-y: auto; /* permet le scroll interne */
-webkit-overflow-scrolling: touch; /* pour un scroll fluide sur iOS */
}
body.no-scroll {
overflow: hidden; /* empêche le scroll global du body */
position: fixed; /* verrouille la position */
width: 100%;
}
.custom-checkbox {
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
font-size: 14px;
color: #333;
user-select: none;
}
.custom-checkbox input[type="checkbox"] {
appearance: none; /* enlève le style par défaut */
-webkit-appearance: none;
width: 18px;
height: 18px;
border: 2px solid #777;
border-radius: 4px;
background-color: white;
position: relative;
transition: all 0.2s ease;
}
.custom-checkbox input[type="checkbox"]:checked {
background-color: #0073e6; /* bleu WP */
border-color: #0073e6;
}
.custom-checkbox input[type="checkbox"]:checked::after {
content: '✔';
color: white;
font-size: 12px;
position: absolute;
left: 2px;
top: -1px;
}
[list]
[*]Livraison offerte à partir de 50€ 🚚
[*]Service client 7j/7 📞
[*]Retour gratuit sous 30 jours 🔄
[/list]
☰
[url=/]
[i]
[/url]
[/i]
[i][/i]
[url=" method="get">
[url=
Подробнее здесь: [url]https://stackoverflow.com/questions/79730903/mobile-sidebar-shifts-and-screen-zooms-when-focusing-an-input-field-wordpress[/url]