RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / 问题 / 1268726
Accepted
Руслан Камов
Руслан Камов
Asked:2022-04-11 17:41:22 +0000 UTC2022-04-11 17:41:22 +0000 UTC 2022-04-11 17:41:22 +0000 UTC

标题捕获了整个导航菜单

  • 772

我正在运行一个训练示例,并且在语义标签完成并且第二个促销部分消失后遇到了一个问题。其中的标题在导航菜单上以一种完全傲慢的方式写着,甚至对按钮都不害羞,它写在按钮的正上方(这里通过片段是看不见的,我可能不知道如何在此处连接 Roboto 字体,所有颜色的屏幕截图都显示了问题)。为什么它不起作用?由引导程序使用

* {
  font-family: "Roboto", sans-serif;
}

header {
  position: relative;
  height: 50px;
}

nav {
  position: fixed;
  width: 100%;
  height: 50px;
  background-color: #212121;
  z-index: 5;
}

.hamburger {
  display: none;
}

.menu {
  display: flex;
  justify-content: space-between;
  padding: 13px 70px;
  margin: 0;
  list-style-type: none;
}

.menu_link {
  color: #ffffff;
  font-size: 15px;
  font-weight: 300;
}
.menu_link:hover {
  text-decoration: none;
  color: #1eacc7;
}

.menu_item {
  border-right: 2px dotted black;
  padding-right: 28px;
}
.menu_item:last-child {
  border-right: none;
}

.subheader {
  position: absolute;
  top: 50px;
  width: 100%;
  height: 84px;
  background-color: rgba(0, 0, 0, 0.6);
}

.subheader_logo {
  display: block;
  max-width: 100%;
  margin-top: 16px;
}

.subheader_official {
  margin-top: 6px;
  opacity: 0.5;
  color: #ffffff;
  font-size: 13px;
  font-weight: 400;
}

.subheader_call {
  color: #ffffff;
  font-size: 12px;
  font-weight: 300;
  margin-top: 19px;
  text-align: right;
}

.subheader_phone {
  display: block;
  margin-top: 8px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 400;
  text-transform: uppercase;
  text-align: right;
  line-height: 12px;
}

.subheader_btn {
  margin-top: 19px;
  width: 172px;
  height: 46px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  border: none;
  border-radius: 4px;
  background-image: linear-gradient(to top, #1eacc7 0%, #4ce2ff 100%);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.21);
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
}
.subheader_btn:hover {
  background-image: none;
  background-color: #1eacc7;
}

.promo {
  min-height: 800px;
  background: url("https://cdn1.savepice.ru/uploads/2021/4/11/f418023a1c0e9994472190ff721cd355-full.jpg") center center/cover no-repeat;
}

.promo_header {
  color: #ffffff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 60px;
  line-height: 60px;
  margin: 0;
  text-align: center;
}

.promo_subheader {
  color: #ffffff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 36px;
  line-height: 36px;
  margin: 0;
  margin-top: 22px;
  text-align: center;
}

.promo_descr {
  color: #ffffff;
  font-size: 18px;
  font-weight: 400;
  line-height: 24px;
  text-align: center;
  margin-top: 23px;
}

.promo_btn {
  display: block;
  margin: 118px auto 0 auto;
  width: 259px;
  height: 63px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
  border: none;
  border-radius: 4px;
  background-image: linear-gradient(to top, #1eacc7 0%, #4ce2ff 100%);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.21);
  color: #ffffff;
  font-size: 18px;
  font-weight: 400;
  text-transform: uppercase;
}
.promo_btn:hover {
  background-image: none;
  background-color: #1eacc7;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
 <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,700&amp;subset=cyrillic-ext" rel="stylesheet">
 
   <header>
        <nav>
            <div class="container">
                <ul class="menu">
                    <li class="menu_item"><a href="#" class="menu_link">Главная</a></li>
                    <li class="menu_item"><a href="#" class="menu_link">Со своим автомобилем</a></li>
                    <li class="menu_item"><a href="#" class="menu_link">На автомобиле компании</a></li>
                    <li class="menu_item"><a href="#" class="menu_link">Требования</a></li>
                    <li class="menu_item"><a href="#" class="menu_link">Контакты</a></li>
                    <li class="menu_item"><a href="#" class="menu_link">Оставить заявку</a></li>
                </ul>
            </div>
            <div class="hamburger">
                <span></span>
                <span></span>
                <span></span>
            </div>
        </nav>
        <div class="subheader">
            <div class="container">
                <div class="row">
                    <div class="col-6 col-md-4 offset-md-1">
                        <a href="#" class="subheader_logo"><img src="https://cdn1.savepice.ru/uploads/2021/4/11/4ef3cdfe37d551d4e75fb29eae407ad9-full.png" alt="logo"></a>
                        <div class="subheader_official">Официальный партнер Uber в Москве</div>
                    </div>

                    <div class="xs-hidden col-md-3 offset-md-1 col-xl-2 offset-xl-2">
                        <div class="subheader_call">Звоните нам ежедневно</div>
                        <a href="tel:84957970988" class="subheader_phone">8 495 797 09 88</a>
                    </div>

                    <div class="col-6 col-md-3 col-lg-2">
                        <a href="tel:84957970988" class="xs-visible subheader_phone">8 495 797 09 88</a>
                        <button class="subheader_btn">заказать звонок</button>
                    </div>
                </div>
            </div>

        </div>
    </header>

    <section class="promo">
        <div class="container">
            <div class="row">
                <div class="col-md-12 offset-md-0 col-lg-10 offset-lg-1">
                    <h1 class="promo_header">КОМПАНИЯ UBER PARTNERS!</h1>
                    <h2 class="promo_subheader">ПРИГЛАШАЕМ ВОДИТЕЛЕЙ! НА СВОЕМ АВТО!</h2>
                    <div class="promo_descr">
                        Компания UBER динамически развивающаяся. Компания на рынке занимает лидирующее место среди
                        таксомоторных компаний, Компания абсолютно прозрачная вы можете контролировать все процессы у
                        себя в личном кабинете. Бонуcная система.Помимо выполненной работы по заказам, компания
                        начисляет бонусы за
                        пиковое время.
                        <br><br>
                        Мы одни из партнеров и зарекомендовали себя как одна из лучших команд в городе Москве. Водители
                        у нас
                        зарабатывают от 80000- 120000 в месяц.
                    </div>
                    <button class="promo_btn">ОТПРАВИТЬ ЗАЯВКУ!</button>
                </div>
            </div>
        </div>
    </section>

在此处输入图像描述

css
  • 1 1 个回答
  • 10 Views

1 个回答

  • Voted
  1. Best Answer
    Crus
    2022-04-11T18:16:30Z2022-04-11T18:16:30Z

    这是因为您为整个标题设置了 50 像素的固定高度。

    '+ 使副标题不是标题的一部分,而是在您的促销块中更合乎逻辑。压到顶部并添加填充。

    * {
      font-family: "Roboto", sans-serif;
    }
    
    header {
      position: relative;
    }
    
    nav {
      position: fixed;
      width: 100%;
      height: 50px;
      background-color: #212121;
      z-index: 5;
      top: 0;
    }
    
    .hamburger {
      display: none;
    }
    
    .menu {
      display: flex;
      justify-content: space-between;
      padding: 13px 70px;
      margin: 0;
      list-style-type: none;
    }
    
    .menu_link {
      color: #ffffff;
      font-size: 15px;
      font-weight: 300;
    }
    .menu_link:hover {
      text-decoration: none;
      color: #1eacc7;
    }
    
    .menu_item {
      border-right: 2px dotted black;
      padding-right: 28px;
    }
    .menu_item:last-child {
      border-right: none;
    }
    
    .subheader {
      position: absolute;
      top: 0;
      width: 100%;
      height: 85px;
      background-color: rgba(0, 0, 0, 0.6);
    }
    
    .subheader_logo {
      display: block;
      max-width: 100%;
      margin-top: 16px;
    }
    
    .subheader_official {
      margin-top: 6px;
      opacity: 0.5;
      color: #ffffff;
      font-size: 13px;
      font-weight: 400;
    }
    
    .subheader_call {
      color: #ffffff;
      font-size: 12px;
      font-weight: 300;
      margin-top: 19px;
      text-align: right;
    }
    
    .subheader_phone {
      display: block;
      margin-top: 8px;
      color: #ffffff;
      font-size: 22px;
      font-weight: 400;
      text-transform: uppercase;
      text-align: right;
      line-height: 12px;
    }
    
    .subheader_btn {
      margin-top: 19px;
      width: 172px;
      height: 46px;
      box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
      border: none;
      border-radius: 4px;
      background-image: linear-gradient(to top, #1eacc7 0%, #4ce2ff 100%);
      text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.21);
      color: #ffffff;
      font-size: 14px;
      font-weight: 400;
      text-transform: uppercase;
    }
    .subheader_btn:hover {
      background-image: none;
      background-color: #1eacc7;
    }
    
    .promo {
      min-height: 800px;
      background: url("https://cdn1.savepice.ru/uploads/2021/4/11/f418023a1c0e9994472190ff721cd355-full.jpg") center center/cover no-repeat;
      position: relative;
      margin-top: 50px;
      padding-top: 100px;
    }
    
    .promo_header {
      color: #ffffff;
      font-weight: 700;
      text-transform: uppercase;
      font-size: 60px;
      line-height: 60px;
      margin: 0;
      text-align: center;
    }
    
    .promo_subheader {
      color: #ffffff;
      font-weight: 700;
      text-transform: uppercase;
      font-size: 36px;
      line-height: 36px;
      margin: 0;
      margin-top: 22px;
      text-align: center;
    }
    
    .promo_descr {
      color: #ffffff;
      font-size: 18px;
      font-weight: 400;
      line-height: 24px;
      text-align: center;
      margin-top: 23px;
    }
    
    .promo_btn {
      display: block;
      margin: 118px auto 0 auto;
      width: 259px;
      height: 63px;
      box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
      border: none;
      border-radius: 4px;
      background-image: linear-gradient(to top, #1eacc7 0%, #4ce2ff 100%);
      text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.21);
      color: #ffffff;
      font-size: 18px;
      font-weight: 400;
      text-transform: uppercase;
    }
    .promo_btn:hover {
      background-image: none;
      background-color: #1eacc7;
    }
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>
     <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,700&amp;subset=cyrillic-ext" rel="stylesheet">
     
       <header>
            <nav>
                <div class="container">
                    <ul class="menu">
                        <li class="menu_item"><a href="#" class="menu_link">Главная</a></li>
                        <li class="menu_item"><a href="#" class="menu_link">Со своим автомобилем</a></li>
                        <li class="menu_item"><a href="#" class="menu_link">На автомобиле компании</a></li>
                        <li class="menu_item"><a href="#" class="menu_link">Требования</a></li>
                        <li class="menu_item"><a href="#" class="menu_link">Контакты</a></li>
                        <li class="menu_item"><a href="#" class="menu_link">Оставить заявку</a></li>
                    </ul>
                </div>
                <div class="hamburger">
                    <span></span>
                    <span></span>
                    <span></span>
                </div>
            </nav>
            
        </header>
        
        
    
        <section class="promo">
            <div class="subheader">
                <div class="container">
                    <div class="row">
                        <div class="col-6 col-md-4 offset-md-1">
                            <a href="#" class="subheader_logo"><img src="https://cdn1.savepice.ru/uploads/2021/4/11/4ef3cdfe37d551d4e75fb29eae407ad9-full.png" alt="logo"></a>
                            <div class="subheader_official">Официальный партнер Uber в Москве</div>
                        </div>
    
                        <div class="xs-hidden col-md-3 offset-md-1 col-xl-2 offset-xl-2">
                            <div class="subheader_call">Звоните нам ежедневно</div>
                            <a href="tel:84957970988" class="subheader_phone">8 495 797 09 88</a>
                        </div>
    
                        <div class="col-6 col-md-3 col-lg-2">
                            <a href="tel:84957970988" class="xs-visible subheader_phone">8 495 797 09 88</a>
                            <button class="subheader_btn">заказать звонок</button>
                        </div>
                    </div>
                </div>
    
            </div>
            <div class="container">
                <div class="row">
                    <div class="col-md-12 offset-md-0 col-lg-10 offset-lg-1">
                        <h1 class="promo_header">КОМПАНИЯ UBER PARTNERS!</h1>
                        <h2 class="promo_subheader">ПРИГЛАШАЕМ ВОДИТЕЛЕЙ! НА СВОЕМ АВТО!</h2>
                        <div class="promo_descr">
                            Компания UBER динамически развивающаяся. Компания на рынке занимает лидирующее место среди
                            таксомоторных компаний, Компания абсолютно прозрачная вы можете контролировать все процессы у
                            себя в личном кабинете. Бонуcная система.Помимо выполненной работы по заказам, компания
                            начисляет бонусы за
                            пиковое время.
                            <br><br>
                            Мы одни из партнеров и зарекомендовали себя как одна из лучших команд в городе Москве. Водители
                            у нас
                            зарабатывают от 80000- 120000 в месяц.
                        </div>
                        <button class="promo_btn">ОТПРАВИТЬ ЗАЯВКУ!</button>
                    </div>
                </div>
            </div>
        </section>

    • 1

相关问题

  • 几何形状的阴影

  • 如何制作这样的人物组合?

  • 如何在css中制作一个图形

  • 如何制作阴影(投影)渐变

  • 网格项目传输不起作用

  • 更改屏幕宽度时换行。引导程序

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    表格填充不起作用

    • 2 个回答
  • Marko Smith

    提示 50/50,有两个,其中一个是正确的

    • 1 个回答
  • Marko Smith

    在 PyQt5 中停止进程

    • 1 个回答
  • Marko Smith

    我的脚本不工作

    • 1 个回答
  • Marko Smith

    在文本文件中写入和读取列表

    • 2 个回答
  • Marko Smith

    如何像屏幕截图中那样并排排列这些块?

    • 1 个回答
  • Marko Smith

    确定文本文件中每一行的字符数

    • 2 个回答
  • Marko Smith

    将接口对象传递给 JAVA 构造函数

    • 1 个回答
  • Marko Smith

    正确更新数据库中的数据

    • 1 个回答
  • Marko Smith

    Python解析不是css

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5