- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的 CSS 有问题,因为我无法将背景图片设置为固定的 div。下面是 codepen 的链接,我在其中构建了我的 html 页面。我真的不知道如何在代码笔中设置背景图像,这就是我设置背景颜色的原因。我有一个 id 为 right-bar 的 div,它的位置是固定的,我已经为它设置了背景图片,但它不显示任何背景。如果我删除固定的位置然后背景出现,但问题是我想要滚动灵 active ,当 div 固定时我得到。
代码笔
http://codepen.io/anon/pen/Lmbtd
HTML
<body>
<div style="width=100%;height=100%;">
<div id="form" style="width: 40%; float:left; height=100%;">
<div id="left-bar">
<input type="text" id="ititle" name="title" placeholder="Title Goes Here">
<br>
<textarea id="tContent" rows="4" cols="50"></textarea>
<br>
<input class="button black" id="submitBtn" type="button" value="Add Me to the Note" onclick="fnSaveContent(event)">
</div>
</div>
<div id="notes" style="width: 60%; float:right;">
<div class="NoteBar">
<p>Notes</p>
</div>
<div id="right-bar" style="
max-height: 100%;
overflow: scroll;
position: fixed;
background: url(../images/bg-right-column.jpg);
/* background-repeat: repeat; */
"><div class="noteContent scdf " id="idc7" style="
background: url(../images/bg-right-column.jpg);
"> <h3>scdf</h3> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> <div class="absButton"><span class="x-btn edit" onclick="fnEdit(this,event)">Edit</span> <span class="x-btn delete" onclick="fnDelete(this,event)">Remove</span></div></div><div class="noteContent wd " id="idc6"> <h3>wd</h3> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> <div class="absButton"><span class="x-btn edit" onclick="fnEdit(this,event)">Edit</span> <span class="x-btn delete" onclick="fnDelete(this,event)">Remove</span></div></div><div class="noteContent qweqweqwe " id="idc5" style="
background: url(../images/bg-right-column.jpg);
"> <h3>qweqweqwe</h3> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> <div class="absButton"><span class="x-btn edit" onclick="fnEdit(this,event)">Edit</span> <span class="x-btn delete" onclick="fnDelete(this,event)">Remove</span></div></div><div class="noteContent re " id="idc4"> <h3>RE</h3> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> <div class="absButton"><span class="x-btn edit" onclick="fnEdit(this,event)">Edit</span> <span class="x-btn delete" onclick="fnDelete(this,event)">Remove</span></div></div><div class="noteContent sadsdasd " id="idc3"> <h3>sadsdasd</h3> <p>asdasdasd</p> <div class="absButton"><span class="x-btn edit" onclick="fnEdit(this,event)">Edit</span> <span class="x-btn delete" onclick="fnDelete(this,event)">Remove</span></div></div><div class="noteContent asdasd " id="idc2"> <h3>asdasd</h3> <p>asdas</p> <div class="absButton"><span class="x-btn edit" onclick="fnEdit(this,event)">Edit</span> <span class="x-btn delete" onclick="fnDelete(this,event)">Remove</span></div></div>
</div>
</div>
</div>
</body>
CSS
<style>
*{
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* ------------------------------------------------
CSS Reset Code Starts
-----------------------------------------------*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
#left-bar{
width: 400px;
margin: auto;
padding-top: 100px;
}
#right-bar{
margin: auto;
max-height: 100%;
overflow: scroll;
position: fixed;
background: url(../images/bg-right-column.jpg);
}
body{
background: url(../images/skulls.png) repeat;
}
input,textarea {
border: 5px solid white;
width: 375px;
-webkit-box-shadow:
inset 0 0 8px rgba(0,0,0,0.1),
0 0 16px rgba(0,0,0,0.1);
-moz-box-shadow:
inset 0 0 8px rgba(0,0,0,0.1),
0 0 16px rgba(0,0,0,0.1);
box-shadow:
inset 0 0 8px rgba(0,0,0,0.1),
0 0 16px rgba(0,0,0,0.1);
padding: 15px;
background: rgba(255,255,255,0.5);
margin: 0 0 10px 0;
}
#submitBtn {
-moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
-webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
box-shadow:inset 0px 1px 0px 0px #ffffff;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #1b9edb) );
background:-moz-linear-gradient( center top, #ededed 5%, #1b9edb 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#1b9edb');
background-color:#ededed;
-webkit-border-top-left-radius:6px;
-moz-border-radius-topleft:6px;
border-top-left-radius:6px;
-webkit-border-top-right-radius:6px;
-moz-border-radius-topright:6px;
border-top-right-radius:6px;
-webkit-border-bottom-right-radius:6px;
-moz-border-radius-bottomright:6px;
border-bottom-right-radius:6px;
-webkit-border-bottom-left-radius:6px;
-moz-border-radius-bottomleft:6px;
border-bottom-left-radius:6px;
text-indent:0;
border:1px solid #dcdcdc;
display:inline-block;
color:#777777;
font-family:arial;
font-size:15px;
font-weight:bold;
font-style:normal;
height:50px;
line-height:15px;
width : 416px;
text-decoration:none;
text-align:center;
text-shadow:1px 1px 0px #ffffff;
}
#submitBtn:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #1b9edb), color-stop(1, #ededed) );
background:-moz-linear-gradient( center top, #1b9edb 5%, #ededed 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#1b9edb', endColorstr='#ededed');
background-color:#1b9edb;
}
#submitBtn:active {
position:relative;
top:1px;
}
.NoteBar{
height : 50px;
background: rgba(77,77,77,1);
background: -moz-linear-gradient(left, rgba(77,77,77,1) 0%, rgba(89,89,89,1) 12%, rgba(102,102,102,1) 25%, rgba(71,71,71,1) 39%, rgba(0,0,0,1) 51%, rgba(0,0,0,1) 51%, rgba(18,18,18,1) 60%, rgba(43,43,43,1) 76%, rgba(28,28,28,1) 91%, rgba(18,18,18,1) 100%);
background: -webkit-gradient(left top, right top, color-stop(0%, rgba(77,77,77,1)), color-stop(12%, rgba(89,89,89,1)), color-stop(25%, rgba(102,102,102,1)), color-stop(39%, rgba(71,71,71,1)), color-stop(51%, rgba(0,0,0,1)), color-stop(51%, rgba(0,0,0,1)), color-stop(60%, rgba(18,18,18,1)), color-stop(76%, rgba(43,43,43,1)), color-stop(91%, rgba(28,28,28,1)), color-stop(100%, rgba(18,18,18,1)));
background: -webkit-linear-gradient(left, rgba(77,77,77,1) 0%, rgba(89,89,89,1) 12%, rgba(102,102,102,1) 25%, rgba(71,71,71,1) 39%, rgba(0,0,0,1) 51%, rgba(0,0,0,1) 51%, rgba(18,18,18,1) 60%, rgba(43,43,43,1) 76%, rgba(28,28,28,1) 91%, rgba(18,18,18,1) 100%);
background: -o-linear-gradient(left, rgba(77,77,77,1) 0%, rgba(89,89,89,1) 12%, rgba(102,102,102,1) 25%, rgba(71,71,71,1) 39%, rgba(0,0,0,1) 51%, rgba(0,0,0,1) 51%, rgba(18,18,18,1) 60%, rgba(43,43,43,1) 76%, rgba(28,28,28,1) 91%, rgba(18,18,18,1) 100%);
background: -ms-linear-gradient(left, rgba(77,77,77,1) 0%, rgba(89,89,89,1) 12%, rgba(102,102,102,1) 25%, rgba(71,71,71,1) 39%, rgba(0,0,0,1) 51%, rgba(0,0,0,1) 51%, rgba(18,18,18,1) 60%, rgba(43,43,43,1) 76%, rgba(28,28,28,1) 91%, rgba(18,18,18,1) 100%);
background: linear-gradient(to right, rgba(77,77,77,1) 0%, rgba(89,89,89,1) 12%, rgba(102,102,102,1) 25%, rgba(71,71,71,1) 39%, rgba(0,0,0,1) 51%, rgba(0,0,0,1) 51%, rgba(18,18,18,1) 60%, rgba(43,43,43,1) 76%, rgba(28,28,28,1) 91%, rgba(18,18,18,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4d4d4d', endColorstr='#121212', GradientType=1 );
}
.NoteBar p{
font-family: "Avant Garde", Avantgarde, "Century Gothic", CenturyGothic, "AppleGothic", sans-serif;
Color : white;
padding-top: 12px;
margin-left: 50%;
}
.noteContent{
border-bottom: 1px grey solid;
border-left: 1px rgb(138, 125, 125) solid;
position: relative;
padding-bottom: 10px;
}
.noteContent h3{
padding: 10px 0px 10px 10px;
}
.noteContent p{
padding-left: 10px;
}
.noteContent .absButton{
position: absolute;
top: 10px;
right: 20px;
}
#notes{
background: url(../images/bg-right-column.jpg);
color:white;
}
/*Edit Icon
span.edit {
height: 10px;
width: 6px;
background: #333;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
position: absolute;
}
span.edit:after {
content: '';
height: 4px;
width: 6px;
background: #333;
-webkit-border-radius: 2px 2px 0 0;
-moz-border-radius: 2px 2px 0 0;
border-radius: 2px 2px 0 0;
position: absolute;
top: -5px;
left: 0px;
}
span.edit:before {
content: '';
width: 0px;
height: 0px;
border-width: 5px 3px 0 3px;
border-style: solid;
border-color: #333 transparent transparent transparent;
position: absolute;
bottom: -6px;
}
span.delete {
width: 10px;
height: 4px;
background: #333;
margin: 15px 0 0 4px;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
span.delete:after {
content: '';
width: 25px;
height: 4px;
background: #333;
position: absolute;
top: 10px;
right: 12px;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
}*/
.x-btn{
border: none;
color: gold;
font-family: inherit;
font-size: 12px;
background: none;
cursor: pointer;
display: inline-block;
text-transform: uppercase;
letter-spacing: 1px;
font-weight: 700;
outline: none;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
transition: all 0.3s;
}
</style>
最佳答案
您用作背景的图像似乎不可用。我从网上添加了一些示例图像并应用了相同的图像。背景照常应用。检查下面的 fiddle 链接。
<div id="right-bar" style="
max-height: 100%;
overflow: scroll;
position: fixed;
background: url(http://isc.stuorg.iastate.edu/wp-content/uploads/sample.jpg);">
关于css - 无法为固定 Div 设置背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24578900/
我通过 spring ioc 编写了一些 Rest 应用程序。但我无法解决这个问题。这是我的异常(exception): org.springframework.beans.factory.BeanC
我对 TestNG、Spring 框架等完全陌生,我正在尝试使用注释 @Value通过 @Configuration 访问配置文件注释。 我在这里想要实现的目标是让控制台从配置文件中写出“hi”,通过
为此工作了几个小时。我完全被难住了。 这是 CS113 的实验室。 如果用户在程序(二进制计算器)结束时选择继续,我们需要使用 goto 语句来到达程序的顶部。 但是,我们还需要释放所有分配的内存。
我正在尝试使用 ffmpeg 库构建一个小的 C 程序。但是我什至无法使用 avformat_open_input() 打开音频文件设置检查错误代码的函数后,我得到以下输出: Error code:
使用 Spring Initializer 创建一个简单的 Spring boot。我只在可用选项下选择 DevTools。 创建项目后,无需对其进行任何更改,即可正常运行程序。 现在,当我尝试在项目
所以我只是在 Mac OS X 中通过 brew 安装了 qt。但是它无法链接它。当我尝试运行 brew link qt 或 brew link --overwrite qt 我得到以下信息: ton
我在提交和 pull 时遇到了问题:在提交的 IDE 中,我看到: warning not all local changes may be shown due to an error: unable
我跑 man gcc | grep "-L" 我明白了 Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for more inf
我有一段代码,旨在接收任何 URL 并将其从网络上撕下来。到目前为止,它运行良好,直到有人给了它这个 URL: http://www.aspensurgical.com/static/images/a
在过去的 5 个小时里,我一直在尝试在我的服务器上设置 WireGuard,但在完成所有设置后,我无法 ping IP 或解析域。 下面是服务器配置 [Interface] Address = 10.
我正在尝试在 GitLab 中 fork 我的一个私有(private)项目,但是当我按下 fork 按钮时,我会收到以下信息: No available namespaces to fork the
我这里遇到了一些问题。我是 node.js 和 Rest API 的新手,但我正在尝试自学。我制作了 REST API,使用 MongoDB 与我的数据库进行通信,我使用 Postman 来测试我的路
下面的代码在控制台中给出以下消息: Uncaught DOMException: Failed to execute 'appendChild' on 'Node': The new child el
我正在尝试调用一个新端点来显示数据,我意识到在上一组有效的数据中,它在数据周围用一对额外的“[]”括号进行控制台,我认为这就是问题是,而新端点不会以我使用数据的方式产生它! 这是 NgFor 失败的原
我正在尝试将我的 Symfony2 应用程序部署到我的 Azure Web 应用程序,但遇到了一些麻烦。 推送到远程时,我在终端中收到以下消息 remote: Updating branch 'mas
Minikube已启动并正在运行,没有任何错误,但是我无法 curl IP。我在这里遵循:https://docs.traefik.io/user-guide/kubernetes/,似乎没有提到关闭
每当我尝试docker组成任何项目时,都会出现以下错误。 我尝试过有和没有sudo 我在这台机器上只有这个问题。我可以在Mac和Amazon WorkSpace上运行相同的容器。 (myslabs)
我正在尝试 pip install stanza 并收到此消息: ERROR: No matching distribution found for torch>=1.3.0 (from stanza
DNS 解析看起来不错,但我无法 ping 我的服务。可能是什么原因? 来自集群中的另一个 Pod: $ ping backend PING backend.default.svc.cluster.l
我正在使用Hibernate 4 + Spring MVC 4当我开始 Apache Tomcat Server 8我收到此错误: Error creating bean with name 'wel
我是一名优秀的程序员,十分优秀!