【发布时间】:2014-01-27 17:56:01
【问题描述】:
在我运行的一个大型社区 wiki 中,我在使用这个 CSS 时遇到了很多麻烦。它过去工作得很好,但后来停止使用 wiki 的指定背景图像,并且破坏了主页的页面格式。
我不是设计 CSS 的人,但我是一名慷慨的志愿者。代码在下面,但我什至不知道什么是坏的,什么不是。
.body {
background-image: url("http://i.imgur.com/Vb4KDsz.jpg");
background-position: top center;
margin:auto;
}
.WikiaPageContentWrapper {
background: #eadfbb;
border: 2px solid #0f1620;
}
.WikiaPageContentWrapper:before {
position: fixed;
left: 50%;
bottom: 35px;
padding-left: 115px;
content: url("http://i.imgur.com/Jg7GHkG.png");
}
#WikiaArticle:before {
position: absolute;
top: 120px;
left: -210px;
content: url("http://i.imgur.com/LVeNyOJ.png");
}
.WikiaPage { border: 0 }
要真正解决这个问题,链接 wiki 会更容易,您可以亲眼看到 CSS 实际上只插入了代码的最后一部分。这是link
例如,主页的格式非常奇怪,具体取决于您的屏幕分辨率,并且 CSS 中指定的背景图像已被灰色背景替换,以及上述代码中的第二个图像。
由于某种原因,在摆弄了第一个答案之后,它导致了一些变化并且背景被恢复了。虽然背景本身是固定的,但页面太宽了,这是我之前解决的格式问题。新/旧代码是:
.i18ndoc {
background-color: #FFF77D;
border-bottom: 1px solid lightgrey;
font-family: monospace;
font-size: 8pt;
height: 140px;
overflow: auto;
padding: 3px;
}
body.mediawiki{
background:url("http://i.imgur.com/W23xCc6.jpg") repeat-x fixed center top #0f1620;
}
.WikiaPageContentWrapper {
background: #eadfbb;
border: 2px solid #0f1620;
margin-top: 10px;
}
.WikiaPageContentWrapper:before {
position: fixed;
left: 50%;
bottom: 50px;
padding-left: 170px;
content: url("http://i.imgur.com/Jg7GHkG.png");
}
#WikiHeader:before {
position: absolute;
top: 270px;
left: -200px;
content: url("http://i.imgur.com/LVeNyOJ.png");
}
.WikiaPage {
border: 0 !important;
}
footer {
position: relative;
z-index: 1;
}
.infobox tr {
line-height: 1em;
}
.infobox tr img {
margin-bottom: 10px;
}
修复后(感谢您的帮助)如何减小屏幕宽度?如果你去link的主页你可以看到这个问题。任何帮助将不胜感激。
【问题讨论】:
-
为什么
#WikiaArticle:before {被注释掉了?哈哈开玩笑。我累了。 -
据我所知,这一切看起来都很好。您能否提供有关您遇到的问题的更多信息?可能会出现任何错误。
-
我们需要相关页面的链接。
-
根据图片,应该是rollplaydnd.wikia.com。
-
确实如此。我缺席了一段时间,CSS坏了:(