0

嘿伙计们,所以我在我构建的 jquery 滑块上设计了一个内容主体.....我的问题是我需要一些图片才能float: left让它们相互对齐,但是父级有一个margin: -6em 0 0 0;,如果我添加float:left它就可以了在父 div 之外......HTML:

 <div id="Content">
        <div class="main_Body">
            <div class="top-halfCont">
                <div class="online_training">
                    <div class="training_image">
                        <img src="images/onlinetraining_home_03.png" width="75" height="75" />
                    </div><!-- .training_image -->
                </div><!-- .online_training -->
                <div class="background_check">
                    <div class="background_image">
                        <img src="images/background_check_home_03.png" width="75" height="75" />
                    </div><!-- .background_image -->
                </div><!-- .background_check -->
                <div class="uninsured_alert">
                    <div class="uninsured_alert_image">
                        <img src="images/unisuredalert_system_03.png" width="75" height="75" />
                    </div><!-- .uninsured_alert_image -->
                </div><!-- .uninsured_alert -->
            </div><!-- .top-halfCont -->
        </div><!-- .main_Body -->
    </div><!-- #Content -->

风格:

/* main content #Content */
#Content {
    display:block;
    max-width:1200px;
    margin:0 auto;  
    background: white;
    position: relative;
    box-shadow: 5px 0px 13px #888888;
}
.main_Body {
    display:block;  
    margin: -6em 0 0 0;
    padding: 1em;
}
.online_training {
    display:block;
    width:200px;    
}
.training_image {
    width:75px;
    height:75px;
    margin:0 auto;  
}
.background_check {
    display:block;
    width:200px;
}
.background_image {
    width:75px;
    height:75px;
    margin:0 auto;  
}
.uninsured_alert {
    display:block;
    width:200px;
}
.uninsured_alert_image {
    width:75px;
    height:75px;
    margin:0 auto;  
}
4

1 回答 1

1

包括以下更改

.top-halfCont{
    margin:6em 0 0 0;
}
.main_Body {
    display:block;  
    margin: -6em 0 0 0;
    padding: 1em;
    overflow:auto;
}
于 2013-03-27T05:56:49.640 回答