Навигационные ссылки перекрывают логотип и смещаются содержимое при прокрутке моего сайтаHtml

Программисты Html
Ответить
Anonymous
 Навигационные ссылки перекрывают логотип и смещаются содержимое при прокрутке моего сайта

Сообщение Anonymous »

Когда я настраиваю размер окна на своем личном веб-сайте, навигационные ссылки не остаются на месте и перемещаются за мой логотип. Кроме того, когда я прокручиваю, контент перемещается вверх, а не остается фиксированным, хотя ниже есть еще контент. Я попытался настроить CSS как можно лучше, но любые изменения, похоже, нарушают положение как логотипа, так и навигационных ссылок в заголовке.




My Name









My Name

Blog
About
Gear


















Welcome to my site

Hi, I'm "My Name". This is my personal space where I write about
coding, tech, and life.






* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: Arial, Helvetica, sans-serif;
background-color: #2e2e2e;
color: #f5f5f5;
line-height: 1.6;
overflow-y: auto;
overscroll-behavior: contain;
}

a {
color: #f5f5f5;
text-decoration: none;
transition: color 0.2s ease;
}

a:hover {
color: #ccc;
}

.header {
position: fixed;
top: 0;
left: 0;
width: 100%;
background: #1f1f1f;
padding: 1rem 2rem;
display: flex;
align-items: center;
justify-content: space-between;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
z-index: 1000;
}

main {
margin-top: 80px;
max-width: 800px;
margin: 80px auto 4rem;
padding: 0 1rem;
min-height: 2000px;
}

.intro {
text-align: center;
margin-bottom: 3rem;
}

.intro h1 {
font-size: 2.5rem;
margin-bottom: 1rem;
}

.recent-posts h2 {
margin-bottom: 1.5rem;
}

.post {
background: #3a3a3a;
padding: 1.5rem;
border-radius: 8px;
margin-bottom: 2rem;
transition: background 0.3s ease;
}

.post:hover {
background: #4a4a4a;
}

.footer {
text-align: center;
padding: 1.5rem;
background: #1f1f1f;
color: #aaa;
font-size: 0.9rem;
}

.post-list {
list-style: none;
padding: 0;
margin-top: 2rem;
}

.post-list li {
background: #3a3a3a;
margin-bottom: 1rem;
padding: 1rem;
border-radius: 6px;
transition: background 0.3s ease;
}

.post-list li:hover {
background: #4a4a4a;
}

.post-list a {
color: #f5f5f5;
font-weight: bold;
}

.navbar {
display: flex;
align-items: start;
width: 100%;
max-width: 1000px;
margin: 0 auto;
}

.logo {
position: absolute;
left: 50px;
top: 15px;
font-size: 1.5rem;
font-weight: bolder;
}

.nav-links {
position: static;
display: flex;
justify-content: flex-start;
gap: 2.5rem;
margin-left: 10;
padding-left: 10px 0;
height: 39px;
align-items: center;
}

.social-links {
font-size: 1.5rem;
display: flex;
margin-left: auto;
gap: 2.5rem;
}


Подробнее здесь: https://stackoverflow.com/questions/798 ... -my-websit
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Html»