- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在制作一个网站,但在尝试修复我的页眉以使其在滚动时保留在页面顶部时遇到了很多麻烦。但是当我尝试添加 position:fixed;滚动条消失。我尝试了在 StackOverflow 和许多其他地方找到的各种解决方案,但都行不通。
body {
padding: 0;
margin-top: 35px;
overflow: scroll;
}
.topBlack-container {
background-color: #333333;
height: 35px;
width: 100%;
position: fixed;
top: 0;
left: 0;
}
.topBlack-contents {
background-color: #333333;
margin: 0 auto;
max-width: 1050px;
border-color: blue;
height: 35px;
}
.list-contents {
float: right;
padding-top: 7px;
padding-right: 7px;
}
.list-contents a {
text-decoration: none;
text-align: center;
font-size: 12px;
font-family: "Arial";
color: white;
padding-left: 20px;
margin-top: 5px;
}
.list-contents a:hover {
text-decoration: underline;
text-align: center;
font-size: 12px;
font-family: "Arial"l color: white;
padding-left: 20px;
margin-top: 5px;
}
<!-- black top bar start -->
<div class="topBlack-container">
<div class="topBlack-contents">
<img src="open-book (2).svg" alt="logo" width="32px" style="padding-left: 7px; padding-top: 0.5px;">
<div class="list-contents">
<a href="home">Home</a>
<a href="About">About</a>
<a href="Contact">Contact Us</a>
</div>
</div>
<!-- black top bar end -->
<div class="container">
<p> Inquietude simplicity terminated she compliment remarkably few her nay. The weeks are ham asked jokes. Neglected perceived shy nay concluded. Not mile draw plan snug next all. Houses latter an valley be indeed wished merely in my. Money doubt oh drawn
every or an china. Visited out friends for expense message set eat. Woody equal ask saw sir weeks aware decay. Entrance prospect removing we packages strictly is no smallest he. For hopes may chief get hours day rooms. Oh no turned behind polite piqued
enough at. Forbade few through inquiry blushes you. Cousin no itself eldest it in dinner latter missed no. Boisterous estimating interested collecting get conviction friendship say boy. Him mrs shy article smiling respect opinion excited. Welcomed
humoured rejoiced peculiar to in an. Two exquisite objection delighted deficient yet its contained. Cordial because are account evident its subject but eat. Can properly followed learning prepared you doubtful yet him. Over many our good lady feet
ask that. Expenses own moderate day fat trifling stronger sir domestic feelings. Itself at be answer always exeter up do. Though or my plenty uneasy do. Friendship so considered remarkably be to sentiments. Offered mention greater fifteen one promise
because nor. Why denoting speaking fat indulged saw dwelling raillery. An so vulgar to on points wanted. Not rapturous resolving continued household northward gay. He it otherwise supported instantly. Unfeeling agreeable suffering it on smallness
newspaper be. So come must time no as. Do on unpleasing possession as of unreserved. Yet joy exquisite put sometimes enjoyment perpetual now. Behind lovers eat having length horses vanity say had its. In as name to here them deny wise this. As rapid
woody my he me which. Men but they fail shew just wish next put. Led all visitor musical calling nor her. Within coming figure sex things are. Pretended concluded did repulsive education smallness yet yet described. Had country man his pressed shewing.
No gate dare rose he. Eyes year if miss he as upon. Unwilling sportsmen he in questions september therefore described so. Attacks may set few believe moments was. Reasonably how possession shy way introduced age inquietude. Missed he engage no exeter
of. Still tried means we aware order among on. Eldest father can design tastes did joy settle. Roused future he ye an marked. Arose mr rapid in so vexed words. Gay welcome led add lasting chiefly say looking. Game of as rest time eyes with of this
it. Add was music merry any truth since going. Happiness she ham but instantly put departure propriety. She amiable all without say spirits shy clothes morning. Frankness in extensive to belonging improving so certainty. Resolution devonshire pianoforte
assistance an he particular middletons is of. Explain ten man uncivil engaged conduct. Am likewise betrayed as declared absolute do. Taste oh spoke about no solid of hills up shade. Occasion so bachelor humoured striking by attended doubtful be it.
Literature admiration frequently indulgence announcing are who you her. Was least quick after six. So it yourself repeated together cheerful. Neither it cordial so painful picture studied if. Sex him position doubtful resolved boy expenses. Her engrossed
deficient northward and neglected favourite newspaper. But use peculiar produced concerns ten. Do to be agreeable conveying oh assurance. Wicket longer admire do barton vanity itself do in it. Preferred to sportsmen it engrossed listening. Park gate
sell they west hard for the. Abode stuff noisy manor blush yet the far. Up colonel so between removed so do. Years use place decay sex worth drift age. Men lasting out end article express fortune demands own charmed. About are are money ask how seven.
Ignorant branched humanity led now marianne too strongly entrance. Rose to shew bore no ye of paid rent form. Old design are dinner better nearer silent excuse. She which are maids boy sense her shade. Considered reasonable we affronting on expression
in. So cordial anxious mr delight. Shot his has must wish from sell nay. Remark fat set why are sudden depend change entire wanted. Performed remainder attending led fat residence far.
</div>
最佳答案
问题是您缺少 topBlack-container
的结束 div
。关闭 div,它将正常工作。
body {
padding: 0;
margin-top: 35px;
overflow: scroll;
}
.topBlack-container {
background-color: #333333;
height: 35px;
width: 100%;
position: fixed;
top: 0;
left: 0;
}
.topBlack-contents {
background-color: #333333;
margin: 0 auto;
max-width: 1050px;
border-color: blue;
height: 35px;
}
.list-contents {
float: right;
padding-top: 7px;
padding-right: 7px;
}
.list-contents a {
text-decoration: none;
text-align: center;
font-size: 12px;
font-family: "Arial";
color: white;
padding-left: 20px;
margin-top: 5px;
}
.list-contents a:hover {
text-decoration: underline;
text-align: center;
font-size: 12px;
font-family: "Arial"l color: white;
padding-left: 20px;
margin-top: 5px;
}
<!-- black top bar start -->
<div class="topBlack-container">
<div class="topBlack-contents">
<img src="open-book (2).svg" alt="logo" width="32px" style="padding-left: 7px; padding-top: 0.5px;">
<div class="list-contents">
<a href="home">Home</a>
<a href="About">About</a>
<a href="Contact">Contact Us</a>
</div>
</div>
</div>
<!-- black top bar end -->
<div class="container">
<p> Inquietude simplicity terminated she compliment remarkably few her nay. The weeks are ham asked jokes. Neglected perceived shy nay concluded. Not mile draw plan snug next all. Houses latter an valley be indeed wished merely in my. Money doubt oh drawn
every or an china. Visited out friends for expense message set eat. Woody equal ask saw sir weeks aware decay. Entrance prospect removing we packages strictly is no smallest he. For hopes may chief get hours day rooms. Oh no turned behind polite piqued
enough at. Forbade few through inquiry blushes you. Cousin no itself eldest it in dinner latter missed no. Boisterous estimating interested collecting get conviction friendship say boy. Him mrs shy article smiling respect opinion excited. Welcomed
humoured rejoiced peculiar to in an. Two exquisite objection delighted deficient yet its contained. Cordial because are account evident its subject but eat. Can properly followed learning prepared you doubtful yet him. Over many our good lady feet
ask that. Expenses own moderate day fat trifling stronger sir domestic feelings. Itself at be answer always exeter up do. Though or my plenty uneasy do. Friendship so considered remarkably be to sentiments. Offered mention greater fifteen one promise
because nor. Why denoting speaking fat indulged saw dwelling raillery. An so vulgar to on points wanted. Not rapturous resolving continued household northward gay. He it otherwise supported instantly. Unfeeling agreeable suffering it on smallness
newspaper be. So come must time no as. Do on unpleasing possession as of unreserved. Yet joy exquisite put sometimes enjoyment perpetual now. Behind lovers eat having length horses vanity say had its. In as name to here them deny wise this. As rapid
woody my he me which. Men but they fail shew just wish next put. Led all visitor musical calling nor her. Within coming figure sex things are. Pretended concluded did repulsive education smallness yet yet described. Had country man his pressed shewing.
No gate dare rose he. Eyes year if miss he as upon. Unwilling sportsmen he in questions september therefore described so. Attacks may set few believe moments was. Reasonably how possession shy way introduced age inquietude. Missed he engage no exeter
of. Still tried means we aware order among on. Eldest father can design tastes did joy settle. Roused future he ye an marked. Arose mr rapid in so vexed words. Gay welcome led add lasting chiefly say looking. Game of as rest time eyes with of this
it. Add was music merry any truth since going. Happiness she ham but instantly put departure propriety. She amiable all without say spirits shy clothes morning. Frankness in extensive to belonging improving so certainty. Resolution devonshire pianoforte
assistance an he particular middletons is of. Explain ten man uncivil engaged conduct. Am likewise betrayed as declared absolute do. Taste oh spoke about no solid of hills up shade. Occasion so bachelor humoured striking by attended doubtful be it.
Literature admiration frequently indulgence announcing are who you her. Was least quick after six. So it yourself repeated together cheerful. Neither it cordial so painful picture studied if. Sex him position doubtful resolved boy expenses. Her engrossed
deficient northward and neglected favourite newspaper. But use peculiar produced concerns ten. Do to be agreeable conveying oh assurance. Wicket longer admire do barton vanity itself do in it. Preferred to sportsmen it engrossed listening. Park gate
sell they west hard for the. Abode stuff noisy manor blush yet the far. Up colonel so between removed so do. Years use place decay sex worth drift age. Men lasting out end article express fortune demands own charmed. About are are money ask how seven.
Ignorant branched humanity led now marianne too strongly entrance. Rose to shew bore no ye of paid rent form. Old design are dinner better nearer silent excuse. She which are maids boy sense her shade. Considered reasonable we affronting on expression
in. So cordial anxious mr delight. Shot his has must wish from sell nay. Remark fat set why are sudden depend change entire wanted. Performed remainder attending led fat residence far.
</div>
关于css - 添加位置时滚动消失 :fixed; to the header,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48134930/
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 3年前关闭。 Improve thi
有人知道可以在线使用 FIX 实用程序来验证修复消息吗?即:接受修复消息并检查诸如正文长度和校验和之类的内容。谢谢 最佳答案 https://fixspec.com 上有一个修复日志解码器.当您输入一
在FIX服务器上发送订单请求并更改标签的顺序。 如果我想要输出由我安排的序列(而不是被服务器修改)。 public void send50(Order order) { quickfix.fi
我正在用 C++ 构建一个 FIX 引擎,但我没有引用来了解什么是好的性能数字。考虑到网络时间和 FIX 解析时间,客户端向服务器发送 FIX 消息的最佳时间(以微秒为单位)是多少?还有人知道这个简单
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求提供代码的问题必须表现出对所解决问题的最低限度理解。包括尝试过的解决方案、为什么它们不起作用,以及
我不明白为什么我的固定背景开始出现,因为它有时没有被固定。 这是一个非常特殊的案例,我知道如何解决它。 您可以删除: .row2 position:relative 或 row1 div -webki
我看过三列的例子(fixed fluid fixed)。但是,我需要一个四列解决方案的示例。 两个外部列是固定的。两个内柱是流动的。 固定 |流体 |流体 |固定 最佳答案 您可以使用 calc .
我试图说服自己输入 Fix和功能 fix是一回事。 但我找不到他们的定义之间的相关性 -- definition of fix fix :: (p -> p) -> p fix f = let {x
这是我已经在这里提出的另一个问题的后续How can I play a single tone or custom wave with Delphi? 长话短说,我使用 MMSystem 的 wave
刚刚完成一个站点并遇到位置问题:已在 IE7 上修复。我用谷歌搜索并尝试了不同的 Doctypes,但固定区域在 IE7 上仍然不在位。 我没有 IE7,但一位客户员工有,我可以使用在线 IE 渲染器
我有我的 设置为 background-attachment: fixed但这留下了我的标签正常滚动。如果我设置 position: fixed到我的标签,它们会跳转到页面顶部。有什么办法可以做与 b
我有一个包含标题页(导航栏)的 php 页面。我想将导航栏显示为固定标题,但每当将其位置更改为固定时,它都会删除滚动条(水平和垂直)并且我无法滚动页面。如果我想保持我的标题固定并且我不想固定位置。我怎
已结束。此问题不符合 Stack Overflow guidelines .它目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是无关紧要的,
我正在使用 jquery mobile,对于页眉/页脚,我使用的是 data-position="fixed"。 但是,当我们滚动页面时......页眉页脚消失并在滚动停止时重新出现.. 有没有一种方
我正在尝试连接到使用 FIX 5.0 的代理 我想利用 quickfixj以方便和快速地实现。 这行吗?我假设 5.0 extends(可以这么说)以前版本的功能,但我不想走得太远,结果导致更多问题,
如何放置 position:fixed内容在页面背景中的容器,而其他内容在其上滚动,同时仍然保持点击背景元素的能力? 效果类似于前景内容在固定背景上滚动的视差滚动情况,但我希望能够将 HTML 放在背
我尝试将 z-index 设置为 body 下的某些位置为 fixed 的元素 示例如下: HTML menu content ....
我花了几个小时寻找这个问题的答案,但其他人提供解决方案的场景似乎比我的稍微简单一些。 有没有办法在固定大小的 div 中放置一个 position:fixed 元素,而该元素不会溢出 div? 换句话
此问题已在 SO 和其他地方多次报告,但我找不到任何有效的解决方案。 如果您有固定位置的 div 和固定附加的背景,在某些特定情况下,在 Google Chrome 上呈现会出现错误(在 Firefo
我想在我网站的页面顶部创建一个标题栏,但我在布局方面遇到了问题。以下是我想要的结果: goal http://ambiguities.ca/images/goal.png 这是 html:
我是一名优秀的程序员,十分优秀!