需要样式帮助 - 一个 div 伸出到一侧。
我有一个页面,在一些样式细节方面似乎无法正确。
http://www.comehike.com/earn_money.php
它有两个问题,我似乎不太对劲(主要是因为设计和造型是我的致命弱点)。
问题1:在底部,页脚div向右突出。我尝试将它包装在 diff div 中,并通过 FireBug 进行查看,但似乎无法让它停止突出....可能是因为我累了并且脑死亡:)
问题 2:你看到主页 div 是如何显示的吗 ?结束于页脚和 div 上方?有没有办法让页面的主要区域延伸到页脚下方?
谢谢!
I have a page which I can't seem to get right in terms of a few styling details.
http://www.comehike.com/earn_money.php
It has two problems with it that I can't seem to get right (largely because design and styling are my Achilles heal).
Problem 1: at the bottom, the footer div sticks out to the right. I tried wrapping it in diff divs, and looking via FireBug, but can't seem to get it to stop sticking out....possibly because I am tired and brain dead :)
Problem 2: Do you see how the main page div ends above the footer and div? Is there way to make the main area of the page extend below the footer?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对于问题的第一部分,您可以通过简单地删除页脚上的
width
属性来修复它,因为它是一个块元素,并且它将占据 100% 的可用宽度(在填充/边距之后) /ETC)。对于您问题的第二部分,我不太确定您在问什么,但我认为您可以将
#mainBody
上的样式更改为:padding: 5px 5px 20px;
或者第三个值的其他大数?For the first part of your question, you can fix it by simply removing the
width
property on your footer, since it's a block element, and it will occupy 100% of the available width (after padding/margin/etc).For the second part of your question, I'm not quite sure what you're asking, but I think you would change the style on
#mainBody
to be:padding: 5px 5px 20px;
or some other large number for the third value?从页脚的 CSS 中删除
width
。如果您希望页脚位于主页中,则必须将其定位在
.basic
Take
width
off of the footer's CSS.If you want the footer to be within the main page, you have to position it within
.basic
将页脚 div 宽度从 960 设置为 900px 将解决页脚伸出
问题 2。布局是正确的。这就是布局
解决此问题的方法,只需将布局更改为此
Set footer div width to 900px from 960 will fix footer sticking out
problem2. The layout is correct how it should be. This is how the layout is
to fix this simply change the layout to this
问题 #1:
您似乎希望页脚宽度为 960 像素。但是您有一个 10 像素的白色边框,实际上使页脚宽度为 980 像素。删除边框,页脚将再次变为您设计的 960 像素。然后看来您必须调整
width: 960px;
直到它正确适合。950px
似乎效果很好。应该是...
问题#2:
您需要将横幅的
和
的内部并靠近底部
Problem #1:
Looks like you want your footer to be 960 pixels wide. But you have a 10 pixel white border which actually makes the footer 980 pixels wide. Remove the border and your footer will again be 960 pixels as you designed. Then it appears you'll have to tweak
width: 960px;
until it fits properly.950px
seems to work well.Should be...
Problem #2:
You need to put the banner's
<div>
and<div class="footer">...</div>
inside of and near the bottom of<div class="basic">...</div>