亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - How to use css to always fix a small box to the bottom of a large box, and the height of the large box is 100%, please give me some advice.
PHP中文網(wǎng)
PHP中文網(wǎng) 2017-06-13 09:23:37
0
5
1913

![Picture uploading...]

PHP中文網(wǎng)
PHP中文網(wǎng)

認(rèn)證高級PHP講師

reply all(5)
漂亮男人
.box {
    position: absolute;
    top: 0;
    left: 0;
}

/* 或者 */
.wrapper {
    display: flex;
    align-items: flex-end;
}
三叔

Let’s see if I guessed what you meant wrong;

<p class="container"> //大容器100%
    <p class="wrapper">
        <p class="content"></p>//內(nèi)容區(qū)域
        <p class="refresh"></p> //小盒子顯示的上拉狀態(tài)
    </p> //滾動區(qū)域
    <p class="scrollBox">
        <p class="bar"></p>
    </p>//我是滾動條
</p>

<style>
.container{
    position:relative;
    height:100%;
    overflow:hidden;
    /*.....*/
}

.wrapper{
    position:relative;
    height:auto;
    /*.....*/
}

.content{
    position:relative;
    height:auto;
    /*....*/
}

.refresh{
    position:relative;
    float : left;
    width:100%;
    height:40px;
    /*......*/
}

.scrollBox{
    position:absolute;
    height:100%;
    right:0px;
    top:0px;
    /*因為scrollBox的父元素是container,而且改變的是content,所以這里不會發(fā)生改變*/
}

.bar{
    position:relative;
    height : /*通過js計算并更新*/;
}
</style>

Here you can make the height of wrapper and content the same, that is, the position is relative, use float here in refresh, and then set the width and height. Because refresh has been separated from the document flow, it will not affect the height of the wrapper, and the container is set to overflow: hidden. When you pull it up too far, refresh will come up naturally. I don't know if this will work.

左手右手慢動作

The most brainless thing is to use position:absolute to achieve:

<body style='margin: 0;font-size: 36px;'>
    <p id='bigbox' style='position: absolute;width: 100%;height: 100%;background-color: rgba(0,0,0,0.2);'>
        <span>大盒子</span>
        <p id='smallbox' style='position: absolute;width: 500px;height: 500px;background-color: red;bottom: 0;'>
            <span>小盒子</span>
        </p>
    </p>
</body>

*It should be noted that the big box also needs to set the position. Only the position of the small box will know who to compare with. If the parent node cannot find the position, it will continue to search upward until it finds the DOM node with the position

女神的閨蜜愛上我

Fixed height + negative margin

阿神

A large p is positioned absolutely, a small p is positioned relatively, and the bottom is 0. Isn’t it ok

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template