0

我正在开发流体布局网页的页脚。这是html:

<div id="footer">
    <div id="lists">
        <div class="list1" id="list-sep">
            <p id="footer-par">
                Lorem Ipsum<br />
                Lorem Ipsum<br />
                Lorem Ipsum Lorem Ipsum<br />
                Lorem Ipsum<br />
                Lorem Ipsum Lorem Ipsum<br />
                PEC<br />
                Lorem Ipsum<br />
                <br />
                &copy; region<br />
            <p>
        </div>
        <div class="list1" id="list-sep">
            <ul>
                <li class="footer-point">President</li>
                <li class="footer-point">Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum Lorem Ipsu</li>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum</li>

            </ul>
        </div>
        <div class="list1" id="list-sep">
            <ul>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum</li>
            </ul>
        </div>
        <div class="list1">
            <ul>
                <li class="footer-point">Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum </li>
                <li class="footer-point">Lorem Ipsum </li>
            </ul>
        </div>
        <hr />
</div>

这是CSS:

@charset "UTF-8";
/* CSS Document */

* {
    margin:0;
    padding:0;
}

#footer {


    height:auto;
    width:100%;
    float:left;
    margin-top:40px;


}

#lists {

    width:75%;

    height:auto;
    margin:20px auto 0 auto;



}



.list1 {


    float:left;
    width:20%;
    height:100%;
    min-height:116px;
    display:block;
    padding-left:4%;
    /*padding-bottom:44px;*/
    /*padding-top:21px;*/


}


#list-sep {

    border-right:1px solid #CCCCCC;


}

.footer-point {

    display:block;
    margin-top:5px;
    font-family:'Myriad Pro';
    font-size:0.6em;
    color:#CCC;
}

#footer-par {

    margin-top:20%;
    margin-bottom:20%;
    font-family:'Myriad Pro';
    font-size:0.6em;
    color:#CCC;

    height:100%;

}

ul {


    margin-top:20%; 
    margin-bottom:20%;

}

列的高度和宽度必须适应其中的文本量(在调整浏览器窗口大小时),但三个分隔符必须具有相同的高度。此外,在调整浏览器大小时,我希望三个分隔符根据文本量调整它们的高度,但它们必须具有相同的高度。换句话说,分隔符必须适应文本最多的列。任何人都可以帮助我吗?任何帮助将非常感激。

4

1 回答 1

0

CSSdisplay: table是你想要的。例如

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">

<style media="all">
@charset "UTF-8";
/* CSS Document */

* {
    margin:0;
    padding:0;
}

#footer {
    height:auto;
    width:100%;
    float:left;
    margin-top:40px;
}

#lists {
    display: table;
    width:75%;
    height:auto;
    margin:20px auto 0 auto;
    border-bottom: 1px solid #ccc;
}

.list1 {
    display: table-cell;
    width:20%;
    padding:4%;
}


#list-sep {
    border-right:1px solid #CCCCCC;
}

.footer-point {
    display:block;
    margin-top:5px;
    font-family:'Myriad Pro';
    font-size:0.6em;
    color:#CCC;
}

#footer-par {
    margin-top:20%;
    margin-bottom:20%;
    font-family:'Myriad Pro';
    font-size:0.6em;
    color:#CCC;
    height:100%;
}

ul {
    margin-top:20%; 
    margin-bottom:20%;
}
</style>

</head>
<body>

<div id="footer">
    <div id="lists">
        <div class="list1" id="list-sep">
            <p id="footer-par">
                Lorem Ipsum<br />
                Lorem Ipsum<br />
                Lorem Ipsum Lorem Ipsum<br />
                Lorem Ipsum<br />
                Lorem Ipsum Lorem Ipsum<br />
                PEC<br />
                Lorem Ipsum<br />
                <br />
                &copy; region<br />
            <p>
        </div>
        <div class="list1" id="list-sep">
            <ul>
                <li class="footer-point">President</li>
                <li class="footer-point">Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum Lorem Ipsu</li>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum</li>

            </ul>
        </div>
        <div class="list1" id="list-sep">
            <ul>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum</li>
            </ul>
        </div>
        <div class="list1">
            <ul>
                <li class="footer-point">Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum</li>
                <li class="footer-point">Lorem Ipsum </li>
                <li class="footer-point">Lorem Ipsum </li>
            </ul>
        </div>
</div>

</body>
</html>
于 2013-04-30T00:37:47.617 回答