html - 我需要 Logo 与导航栏重叠

标签 html css

我希望 Logo 像这样重叠在我的导航栏上:

enter image description here

到目前为止,我有这个: enter image description here

如您所见, Logo 只会使导航栏变大,如何使 Logo 与导航栏重叠? 代码笔是 https://codepen.io/anon/pen/NvqbLo

我认为问题出在 CSS 上:

.topnav a {
  float: left;
  display: block;
  color: #777;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
}

最佳答案

Logo 应该是float:left,菜单标签应该是float:right

.topnav a {
  float: left;
  display: block;
  color: #777;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
   background-color: #134095;
  margin-left:3px;
  color:#fff;
}

也在 coded your link 更新

关于html - 我需要 Logo 与导航栏重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45333884/

相关文章:

javascript - 桌面和移动 View 的占位符

javascript - Bootstrap 日期选择器 : Misaligned

html - 在 Angular 中,如何将类的变量设置为函数的结果?

html - 你可以使用线性渐变属性来做垂直背景颜色吗

html - css 符合文本以避免背景图像

javascript - 监听元素禁用事件

javascript - 滚动时如何重叠html正文中的部分?

twitter-bootstrap - 在卡片组中堆叠 Bootstrap 4 卡片

html - 将共享按钮悬停在每个图像上

javascript - 具有功能嵌套输入的 HTML 按钮