css - 960gs 垂直填充 Div CSS

标签 css html 960.gs

我知道这个 CSS 问题在互联网上随处可见。但是我很难让紫色和绿色的 div 填充它们的剩余空间,因此它们与黄色的推特提要的高度相同:

http://jsfiddle.net/n5558/

HTML

<div id="main">
    <div id="primary" class="home">
        <div id="content" role="main">
            <div id="main-content" class="container_12">
                <div id="info" class="grid_4">
                    <div id="networking">
                            <h2>RSViP - Business Networking</h2>

                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In rhoncus lobortis orci, sed vestibulum leo dapibus et. Fusce in dolor velit, sit amet vehicula est. Integer elit sapien.</p>  <a href="">Apply for Business Networking</a>
    <a href="">Free Trial</a>

                    </div>
                    <div id="card">
                            <h2>RSViP - Card</h2>

                    </div>
                </div>
                <div id="twitter" class="grid_4">
                        <h2>News / Twitter Feed</h2>

                    <ul>
                        <li>
                            <p>Details of our next Business Network Social &amp; 5th Birthday have been finalised- Invitations going out tomorrow to members <a href="http://www.twitter.com/HartsNottingham" target="_blank">@HartsNottingham</a>

                            </p>
                            <p id="date">3rd Apr 04:57 PM</p>
                        </li>
                        <li>
                            <p>Details of our next Business Network Social &amp; 5th Birthday have been finalised- Invitations going out tomorrow to members <a href="http://www.twitter.com/HartsNottingham" target="_blank">@HartsNottingham</a>

                            </p>
                            <p id="date">3rd Apr 04:08 PM</p>
                        </li>
                        <li>
                            <p>Details of our next Business Network Social &amp; 5th Birthday have been finalised- Invitations going out tomorrow to members <a href="http://www.twitter.com/HartsNottingham" target="_blank">@HartsNottingham</a>

                            </p>
                            <p id="date">3rd Apr 03:28 PM</p>
                        </li>
                        <li>
                            <p>Details of our next Business Network Social &amp; 5th Birthday have been finalised- Invitations going out tomorrow to members <a href="http://www.twitter.com/HartsNottingham" target="_blank">@HartsNottingham</a>

                            </p>
                            <p id="date">3rd Apr 03:28 PM</p>
                        </li>
                    </ul>
                </div>
                <div id="col3" class="grid_4">
                        <h2>RSViP Free Subscription</h2>

                </div>
            </div>
        </div>
    </div>
</div>

CSS

.home #main-content {
    margin-top: 23px;
    margin-bottom: 23px;
    height: 100%;
}

/*Col1 - Info*/
.home #info {
    width: 270px;
    padding-right: 30px;
    background: url('images/divider.png') repeat-y top right;
    height: 100%;
    background: purple;
}

/*Col2 - Twitter*/
.home #twitter {
    padding-left: 10px;
    width: 290px;
    background: yellow;
}

.home #twitter ul {
    list-style: none;
    margin: 0; padding: 0;
}

/* Col3 */
.home #col3 {
    background: green;
}

/* 960.gs */

谢谢你,彼得

最佳答案

这是我有效的解决方案/技巧:

.home #main-content {
    margin-top: 23px;
    margin-bottom: 23px;
    overflow: hidden;
}

.home #main-content div {
    padding-bottom: 9999px;
    margin-bottom: -9999px;
}

关于css - 960gs 垂直填充 Div CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15795810/

相关文章:

javascript - Facebook likebox - CSS 问题

javascript - 为什么我的 Vue 组件没有绑定(bind)样式?

css - 960.gs 布局问题

javascript - 折叠只有一个元素打开在 AngularJS 中不起作用

html - 有没有办法找到 Phonegap 渲染的字体?

html - 使用 pandoc 将 html 转换为 json

javascript - jQuery 是否支持 Canvas ?

html - ASP :TextBox; is there an "OnFocus" or CSS equivalent

css - 网格 960 CSS 问题

css - 位置 : absolute pushes content to right in Opera/FF/IE but not with Webkit browsers