简体   繁体   English

全高度border-right of divs with float:left

[英]full height border-right of divs with float:left

I need full height border-right of first and second divs with float:left 我需要第一个和第二个div的全高度border-right with float:left
CSS: CSS:

div.wrapper {
    border: 1px solid black;
}
div.wrapper > div {
    text-align: center;
    width: 50px;
    padding-left: 5px;

    float: left;
}
div.w-1, div.w-2 {
    border-right: 1px solid black;
}

HTML: HTML:

   <div class='wrapper'>
        <div class='w-1'>
            <p>text</p>
        </div>
        <div class='w-2'>
            <p>text</p>
            <p>text</p>
        </div>
        <div class='w-3'>
            <p>text</p>
            <p>text</p>
            <p>text</p>
        </div>
        <br style='clear: both;'>
    </div>

please help with solution. 请帮忙解决。 Have jsfiddle here http://jsfiddle.net/kto5pupz/ 这里有jsfiddle http://jsfiddle.net/kto5pupz/

HTML HTML

<div class='wrapper'>
    <div class='w-1'>
        <p>text</p>
    </div>
    <div class='w-2'>
        <p>text</p>
        <p>text</p>
    </div>
    <div class='w-3'>
        <p>text</p>
        <p>text</p>
        <p>text</p>
    </div>
    <br style='clear: both;'>
</div>

CSS CSS

div.wrapper {
    border: 1px solid black;
    overflow: hidden;
}
div.wrapper > div {
    text-align: center;
    width: 50px;
    padding: 0 0 9999px 5px;
    float: left;
    border-left: 1px solid black;
    margin: 0 0 -9999px;
}
div.wrapper > div:first-child{
    border: none;
}

Link to fiddle 链接到小提琴

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM