2

所以我有(.section-page-layout)一个边距为(margin-top:-200px)的 div ,并且 div(.section-page-layout)正在 div 下方(.section-page-header),它应该越过它。我将代码上传到了一个演示链接,您可以在其中使用 Firebug 或其他工具查看它。我还包括了我的代码。

http://kmgp.us/stackoverflow/section_page_template.html

提前致谢!

CSS 代码

/* Header */
.section-page-header {
    background: url("../img/frontcover.jpg") no-repeat;
    background-size: cover;
    width: auto;
    height: auto;
    min-height: 727px;
    min-width: 1280px;
}
.section-page-header-title_container {
    width: 1280px;
    position: relative;
    margin: 0 auto;
}
.section-page-header-title {
    margin-top: 83px;
    border-top: 7px #5b461c solid;
    width: 1170px;
    float: left;
    height: 167px;
    background: #000000;
    -webkit-border-radius: 0px 0px 50px 0px;
    border-radius: 0px 0px 50px 0px;
    /* IE 8 */
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=90)";
    /* IE 5-7 */
    filter: alpha(opacity=90);
    /* Gecko */
    -moz-opacity: 0.9;
    /* Safari 1.x */
    -khtml-opacity: 0.9;
    /* CSS3 */
    opacity: 0.9;
}
.section-page-header-title h1 {
    font-family: 'QuicksandBook';
    margin-left: 147px;
    margin-top: 46px;
    font-size: 50px;
    color: #FFFFFF;
    text-transform: uppercase;
}
.section-page-header-title p {
    margin-top: 12px;
    margin-left: 147px;
    font-family: 'junctionregularRegular';
    color: #ff9900;
    text-transform: uppercase;
}
.section-page-layout-container {
    background:#984B09;
    background: url('../img/section-page-oj_gradient-background.png') repeat-y;
    background-size:contain;
    width: 100%;
    overflow: hidden;
}
.section-page-layout {
    width: 1280px;
    position: relative;
    margin: 0 auto;
    height: auto;
    overflow: visible;
    margin-top:-200px;
}
.left-section-container {
    width: 585px;
    height: 500px;
    background: #FFFFFF;
    float: left;
}

代码

<!-- ===============
=== Section Page Template
=============== -->
<header class="section-page-header">
    <div class="section-page-header-title_container">
        <div class="section-page-header-title">
            <h1>ABOUT <b>US</b></h1>
            <p>A simple glance into our company</p>
        </div>
    </div>
</header>
<section class="section-page-layout-container">
    <div class="section-page-layout">
        <div class="left-section-container">
            <header> </header>
            <div class="left-section">
            </div>
        </div>
        <div class="right-module-section">

        </div>
    </div>
</section>
<div class="clear"><!-- Clear --></div>
4

1 回答 1

3

If you have overflow:hidden on a parent element then when you move the child outside of the parent it will be hidden.

于 2013-03-26T20:39:58.783 回答