2

だから私は(.section-page-layout)マージンのあるdivを持っていて、 (margin-top:-200px)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;
}

HTMLコード

<!-- ===============
=== 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

overflow:hidden親要素がある場合、子を親の外に移動すると、子は非表示になります。

于 2013-03-26T20:39:58.783 に答える