0

Здравствуйте.

Нужно сделать шапку сайта,с ссылками по центру, поверх остальных блоков, но если задать position: fixed/absolute, то шапка не на всю ширину получается, а прилипает к левому краю вместе с внутренними ссылками.

HTML:

.header1{
    position: fixed !important;
    z-index: 100;
    overflow: hidden;
    font-size: 20pt;
    text-align: center !important;
    background-color: rgba(0, 125, 215, 0.6);
    height: 100px;
    weight: 100%;
}
.header1 a {
    display: inline-block;
    padding: 30px;
    color: #0e0c13 !important;
    text-decoration: none !important;
    transition: all 500ms ease;
}
.header1 a:before {
    display: inline-block;
    padding: 30px;
    color: #0e0c13 !important;
    transition: all 2s ease;
    text-decoration: none !important;
}
.header1 a:hover {
    display: inline-block;
    padding: 30px;
    color: #9625ff !important;
    text-decoration: none !important;
    transition: all 2s ease;
}
<div class="header1"> 
    <a href="#about">About</a>
    <a href="#home">Home</a>
    <a href="#contact">Contact</a>
</div>

Я только начинаю, поэтому могу допускать тупые ошибки, заранее прошу извинить, и, конечно же, спасибо.

2
  • Очепятка. "weight" нужно заменить на "width"
    – Ein
    23 мая 2022 в 15:40
  • Да! Спасибо, перепутал ширину с весом xd. Глупо вышло...
    – Ander
    23 мая 2022 в 16:02

0

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Посмотрите другие вопросы с метками или задайте свой вопрос.