Выпадающее меню не ровно под ссылкой
Когда навожу курсор на ссылку выпадающее меню оказывается где-то слева, а не прям под ней. Css код ниже
margin: 0;
padding: 0;
font-family: Arial;
overflow-x: hidden;
height: 100vh;
background: url("background.jpg");
jpg: no-repeat;
background-size: cover;
background-position: center;
backdrop-filter: blur(10px);
}
header {
background-color: rgba(255,255,255, 0.85);
padding: 20px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 8%;
}
header ul {
list-style-type: none;
}
header li {
border: 1px 0;
margin: 5px 0;
}
header li a {
color: black;
font: bold 120% Arial, Helvetica, sans-serif;
padding: 5px;
text-decoration: none;
}
header li a:hover {
background: rgba(127, 127, 127, 0.25);
}
header a em {
color: #333;
display: block;
font: normal 85% Verdana, Helvetica, sans-serif;
line-height: 125%;
}
header a span {
color: #125F15;
font: normal 70% Verdana, Helvetica, sans-serif;
line-height: 150%;
}
header img {
height: 100px; /* Уменьшение размера изображения на 50% */
margin-right: 40px;
}
header a {
color: black;
text-decoration: none;
margin-right: 20px;
display: inline-block;
}
nav ul li ul {
position: absolute;
left: 0;
width: 180px;
background: #fff;
display: none;
}
nav ul li ul li {
width: 100%;
border: 1px solid rgba(0, 0, 0, 0.1);
}
nav ul li:hover > ul {
display: initial;
}
footer {
background-color: rgba(51, 51, 51, 0.7);
max-width: 1500px;
color: white;
margin: 0;
padding: 20px;
position: absolute;
bottom: 0;
width: 100%;
overflow-x: hidden; /* Убираем полосу прокрутки по горизонтали */
}
footer a {
color: white; /* Цвет ссылок в футере */
text-decoration: none;
margin-right: 20px;
}
.copyright {
float: right;
font-size: 12px;
}
.preloader {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: white;
z-index: 9999; /* Установить высокий уровень z-index, чтобы элемент был поверх других элементов */
display: flex;
justify-content: center;
align-items: center;
}
body {
opacity: 1;
transition: opacity 0.3s ease-in-out;
}
body.loaded {
opacity: 1;
}
.video-container {
display: flex;
justify-content: center;
align-items: center;
height: 60vh;
}
.marquee {
background-color: green; /* светло-зеленый цвет фона */
width: 100%;
height: 30px;
overflow: hidden;
position: relative;
}
.marquee span {
position: absolute;
display: inline-block;
white-space: nowrap;
animation: marquee 30s linear infinite;
color: white;
animation-iteration-count: infinite;
font-weight: bold;
}
@keyframes marquee {
0% {
left: 100%;
}
100% {
left: -100%;
}
}
.modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0, 0, 0, 0.4);
}
.modal-content {
background-color: white;
margin: 15% auto;
padding: 20px;
border: 1px solid #888;
width: 50%;
height: 70%;
position: relative;
}
.close {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
position: absolute;
right: 10px;
top: 0;
}
.close:hover,
.close:focus {
color: #000;
cursor: pointer;
}
input[type=text], textarea {
width: 100%;
padding: 12px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
margin-top: 6px;
margin-bottom: 16px;
resize: vertical;
}
input[type=submit] {
background-color: blue;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #45a049;
}
.container {
border-radius: 5px;
background-color: #f2f2f2;
padding: 20px;
}
Источник: Stack Overflow на русском