Div必须低于绝对位置

时间:2015-09-20 21:55:57

标签: html css position absolute

div“bot_wrapper”需要位于top_wrapper之下,ABOUTme需要始终在100px中。有什么建议吗?

http://rileykinsella.net76.net/

2 个答案:

答案 0 :(得分:1)

<div class="bottom_wrapper" style="padding-left: 5px; padding-top: 5px;">
            <div class="article_wrapper">
                <div class="article_title">
                     <span>ABOUT<div class="second_word"><span>me<span></div></span>
                </div>
            </div>
        </div>

将5px更改为左侧/顶部的正确px移动,以对齐您想要对齐的位置。您也可以使用%值而不是px。风格= “填充左:5%;”等

答案 1 :(得分:0)

您可以尝试使用position:absolute来放置bottom_wrapper。如果顶部包装器总是具有该高度,那么您可以这样做:

.bottom_wrapper{
    position: absolute;
    width: 100%;
    bottom: 0px;
}

这将始终将底部包装器对齐到页面底部。

至于放置关于我,我不明白你的意思是“100px总是”

编辑1:

将top_wrapper更改为:

.top_wrapper{
    background: url(images/bg.jpg) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    border-bottom: 6px solid #39B54A;
    height: 80%;
    width: 100%;
    min-height: 602px;
}

然后将bottom_wrapper更改为:

.bottom_wrapper{
    width: 960px;
    margin-left: auto;
    margin-right: auto;
}