2

这真让我抓狂。我正在 Wordpress 中构建一个新的水平滚动网站。页眉和页脚是简单的固定元素,但页面内容是水平滚动的。我不是试图在帖子中这样做,而是作为一个页面。一切正常,直到我达到一定的宽度,然后我的图像创建了一个新行,打乱了整个页面的流程。然后它也会隐藏页脚。我已经在多个浏览器中查看过这个,并且被困在做什么。我不应该可以随心所欲地水平滚动吗?好像我在我的网站上达到了某种最大宽度。

这里看起来不错,然后如果我使用 div 以相同的方式添加另外两个图像,它会跳过一行并将所有内容都搞砸并且看起来很糟糕

请帮忙。这是相关的CSS:

/************************* GLOBAL STYLES ***************************/
body {color:#eee; background: #000000}
.container-inner {position:relative; overflow:auto}
.container {background:#111; position:relative; overflow:auto}
h1,h2,h3,h4,h5,h6 {color:#eee;}
h1 a,h2 a,h3 a,h4 a,h5 a,h6 a {color:#eee;}
h3.sub,h2.sub {margin: 0 0 10px 0;padding: 0 0 5px 0;font-size: 1.9em;font-weight: bold;line-height: 1em;text-transform: uppercase;letter-spacing: 2px;color: #515151;border-bottom: 1px solid #000;}
a {color:#428ce7;text-decoration:none;}
a:hover, a:focus {color:#fff;}
p {color:#eee;}
h6.top {color:#ccc;}
.login {float:left;}

/* Posts */
.content {font-size: 1.2em; position:relative; overflow:auto}
.content h2 {font-size:1.5em; border: 3px solid white; text-align: center; padding: 2px;}
.post {display:block;font-size: 1.2em;}
.post h4, .post h6 {font-size: 1.2em;}
.post h2 {font-size:1.5em; border: 3px solid white; text-align: center; padding: 2px;}
.postmetadata {background:#000;padding:1em;color:#999; font-size:10px;-moz-border-radius: 5px;-khtml-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 5px;}
.postmetadata a {}
.postmetadata a:hover {color:#fff;}
.underlined {border-bottom:1px solid #eee;}
h6.underlined {margin:0 0 1em;}
.welcomebox {padding:1.5em;margin-bottom:1.5em;color:#eee;text-shadow: 1px 1px 1px #000}

.nav-image-left, .nav-image-up, .nav-image-right {text-align:center;float:left;width:25px;margin:0 10px 0 2px;}
.nav-image-left a, .nav-image-up a, .nav-image-right a {background:#eee;padding:2px 48% 2px 48%;text-decoration:none;color:#000;}
.nav-image-left a:hover, .nav-image-up a:hover, .nav-image-right a:hover {background:#000;color:#fff;}
.nav {background:#eee;margin:0 0 1em 0;-moz-border-radius: 5px;-khtml-border-radius: 5px;-webkit-border-radius: 5px;border-radius: 5px;}
.nav:hover {background:#ccc;}
.prev a, .next a {color:#222;text-decoration:none;padding:.2em 1em;}

.nav-interior {margin:0;padding:0;clear:both;display:inline;}
.nav-interior .next {color:#000;text-decoration:none;float:right;}
.nav-interior .prev {color:#000;text-decoration:none;float:left;}

/* Paragraph */
#paragraph {margin:0px 30px 0px 30px; text-align:justify;}

/* Horizontal Scroll */
#wrapper {
    float:left;
    margin:40px 20px 30px;
    margin-right:-999em;
    position:relative;
    overflow:auto;
}

.floatbox {
    float:left; 
    margin:0 20px 0 0;
    white-space:nowrap;
}

.floatbox img {float:left;}

.floatboxtext {
    width:480px;
    float:left;
    margin:20px 60px 0 40px;
    font-family:"Courier New", Courier, monospace;
    text-align:justify;
    font-size:.8em;
    overflow:hidden;
}

/* Footer */
#footer {padding:1.5em 0; margin:0 auto; color:#999; text-align:center; border-top:2px solid #333; position:fixed; width:100%}
#footer p {color:#999}
#footer h3 {margin:0;padding:0 0 .4em 0; border-bottom:none; color:#999}
4

1 回答 1

1

知道这是如何工作的,但至少对我有用:

#wrapper {
    margin-right:-999em;
}

到:

#wrapper {
    margin-right: -99999em;
}

你的例子盯着工作-1080em,所以我假设margin-right确定它的最大宽度。我把它说成是-99999em因为它看起来足够大,你可以增加它。

于 2013-03-04T22:06:53.847 回答