1

I need the div "child2" to keep a small distance from child1 which contains dynamic data , and also currently the data in child1 is being overflowed,i don't get it

    <div id="parent">
    <div id="child1">
<br/>
    <div id="child2">
    </div

with the style of these div's being as described below

#child2
{
width: 300px;
    left: 550px;
    position: relative;
    color: #27CCFF;
    z-index: 0;
    border: thin solid #CDCDCD;
    top: auto;
}
#parent {
    position: relative;
    width: 924px;
    -webkit-box-shadow: 3px 3px 30px #E4E4E4;
    -moz-box-shadow: 3px 3px 30px #E4E4E4;
    box-shadow: 3px 3px 30px #E4E4E4;
    background-color: #E4E4E4;
    left: 192px;
    height: auto;
}
#child2 {
    top: 0px;
    width: 800px;
    color: #333333;
    font-size: 14px;
    font-family: Arial;
    left: 50px;
    position: relative;
    float: left;
}
4

1 回答 1

2

你可以使用 :margin来做到这一点,

如果保证金不起作用,您可以使用padding

#child2 {
    top: 0px;
    width: 800px;
    color: #333333;
    font-size: 14px;
    font-family: Arial;
    left: 50px;
    position: relative;
    float: left;
    margin-top: ...;
    OR padding-top: ...;
}
于 2013-11-10T17:21:30.350 回答