- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
谁能帮我弄清楚如何将我的菜单栏 (w/id = "topnav") 置于我的 HTML 页面顶部的中心?我尝试了一堆背景大小的东西,但似乎没有任何效果。我希望它固定并在滚动时水平填充页面。
#topnav a{
text-decoration: none;
color: #000;
padding-left: 50px;
padding-right: 50px;
padding-bottom: 10px;
}
#topnav{
font-family: Courier;
text-align: center;
padding: 15px;
position: fixed;
left: 50%;
transform: translateX(-50%);
background: white;
/*background-size: 100% auto !important;*/
}
最佳答案
您是否尝试过将宽度设置为 100%?
编辑:
#topnav{
font-family: Courier;
text-align: center;
padding: 15px;
position: fixed;
left: 50%;
transform: translateX(-50%);
background: black;
/*background-size: 100% auto !important;*/
width: 100%;
top: 0;
}
这应该可行
关于html - 在 CSS 中格式化 topnav,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45517256/
在此站点上 http://exact-mats.myshopify.com/我们希望 Logo 上方空白的高度等于其下方空白的高度。 我找不到实现此目的的 CSS 规则。 我可以看出我们需要针对某些东
我在将我网站上的顶部导航(如果您会看到下面的链接、“主页”、“存档”和“关于”按钮)与我想要的位置保持一致时遇到了一些麻烦让它在浏览器调整大小时保持不变,它位于我横幅的右边缘。最初,我有四个按钮并设法
我的 topnav 不在顶部,它有大约 5px 的奇怪填充为了测试我刚刚创建了一个简单的 header.html + header.css我的 header.html: 我的 header.cs
我有一个简单的页面,其中包含:一个header、一个topnav 和一个body。topnav 将包含一个链接(可变宽度,因为它将是登录用户的名称)以打开下拉菜单。 问题:下拉菜单被topnav“裁剪
我几乎一整天都在处理这个问题。我快到了。只需要收尾,我不知道如何实现。 我的导航应该是这样的: 这是桌面版本的外观: body, html { max-width: 100%; pad
我制作了一个导航水平栏,但我似乎有以下问题并且不确定到底是什么导致了它。我希望背景延伸到列表的边缘。 HTML代码... ">Home ">Login ">Register
我试图将当前的“事件”链接设置为白色以显示用户所在的页面。我在以前的帖子中看到“一个链接只有在被点击时才会进入 a:active 状态,所以你只能看到几秒钟的变化。你应该寻找一种不同的方式来完成它,比
谁能帮我弄清楚如何将我的菜单栏 (w/id = "topnav") 置于我的 HTML 页面顶部的中心?我尝试了一堆背景大小的东西,但似乎没有任何效果。我希望它固定并在滚动时水平填充页面。 #topn
在小屏幕上,topnav 导航必须点击两次才能打开。我不知道是什么问题。我当然想实现当用户点击图标时的状态,topnav 打开并显示其余按钮(在一行中)。我必须让搜索输入字段始终位于顶部导航中。
我有一个客户要求为 MOSS topnav 中的每个单独的导航单元格使用不同的颜色。我知道如何设计整个顶部导航栏的样式,但想不出一种方法来分别为它们着色。 我查看了 SharePoint 生成的源代码
我正在使用来自 this site 的纯 css 菜单.它工作正常,但如果我尝试在菜单未处于“汉堡菜单”模式时将其居中或右对齐,我将无法正常工作。 我已经尝试了 this stackoverflow
我有这段来自 w3schools 的代码可以使用。它是一个响应式顶部导航,媒体查询 660px 上的 shriks,但是当我点击时,它没有天赋,它只是出现和消失。我怎样才能让它慢慢滑入和滑出? jav
希望有人能发现我遗漏的内容,我正在处理同时包含顶部导航和侧边导航的页面。我希望 topnav 保持在最上面。我希望 sidenav 在它下面,而不重叠它。 这是我的 fiddle您可以通过点击橙色汉堡
我的 topNav 在 IE6 中的 CSS 问题 HTML 页面: http://www.faressoft.net 最佳答案 你在内联元素中有 block 元素,即你在你的 ul 标签中有 div
在我使用 jQuery 和 jQuery UI(分别为 1.10.2 和 1.10.4)的 Web 应用程序中,我在 /js/jquery-ui-1.10.4/css/ui-lightness 中使用
我没有做太多前端 - 我的问题是双重的,当高度设置为 100% 时,我的 .row div 推过 viewport - 我猜这与topnav 和侧边栏之间的相对/固定位置交互?我该如何解决?滚动时如何
我是一名优秀的程序员,十分优秀!