2015-04-04 78 views
0

好的,所以我有兩個div,'大約'和'tc-wrap'。我可以更改大約包裝的頂部邊界,但不能用tc-wrap。我發現了一個老問題,說你需要浮動div,但是如果沒有它,就需要重新打包,而tc-wrap也不能使用它。這是我的HTML:頂部保證金不在這兩個部門

<div id="about-wrap"> 
     <div class="about"> 
      <p></br><h1><bold>About Us</bold></h1></p> 

      <p class="about-us"><h5>Next Gen was founded in late 2014 by nG Fearr (then known as nG FearIess). It began as an XBox 360 clan, now trying to grow in XBox One. We are multi-COD players, and play Modern Warfare 3 and 2, Advanced Warfare and mainly Black Ops 2. Although Next Gen began with only 1 founding member, it has rapidly grown and currently has over 25 clan members. 
      </br></br> 
      In Next Gen, our primary focus is sniping/feeding. We currently have an RC and are looking for snipers. If you would like to join, please submit your clips and contact us. For information about try outs, please contact our leader at [email protected] .</h5></p> 
    </div> 
</div> 

<div id="tc-wrap"> 
    <div class="tc"> 
     <p>Test</p> 
    </div> 
</div> 

和我的CSS:

#about-wrap { 
width: 58.5%; 
background-color: #FFF; 
width: 800px; 
height: 600px; 
margin-left: 3%; 
margin-top: 6%; 
} 

.about h1 { 
    font-family: "Bitter"; 
    color: #000b22; 
    margin-left: 3%; 
} 

.about h5 { 
    font-family: "Roboto"; 
    color: #3d4942; 
    margin-left: 3%; 
} 

.tc { 
    width: 21%; 
    background-color: #000; 
    height: 60px; 
    margin-right: 3%; 
    float: right; 
} 

請告訴我,什麼是錯的..謝謝。

+0

你在寬度上使用了兩次'#about-wrap'和'.tc' ...你想要哪個寬度? – Logz 2015-04-04 12:07:28

+0

@ user10哎呀,我的錯誤..我現在編輯我的帖子 – ieblake 2015-04-04 12:16:19

+0

這是固定的高度,它會阻止你刪除margen這裏檢查http://jsfiddle.net/bqspgchv/ – MKD 2015-04-04 12:18:44

回答

0

我想通了。我改變

#about-wrap { 
width: 58.5%; 
background-color: #FFF; 
width: 800px; 
height: 600px; 
margin-left: 3%; 
margin-top: 6%; 
} 

.about h1 { 
    font-family: "Bitter"; 
    color: #000b22; 
    margin-left: 3%; 
} 

.about h5 { 
    font-family: "Roboto"; 
    color: #3d4942; 
    margin-left: 3%; 
} 

.tc { 
    width: 21%; 
    background-color: #000; 
    height: 60px; 
    margin-right: 3%; 
    float: right; 
} 

這個

#about-wrap { 
    width: 58.5%; 
    float: left; 
    background-color: #FFF; 
    height: 400px; 
    margin-top: 6%; 
    margin-left: 3%; 
} 

.about h1 { 
    font-family: "Bitter"; 
    color: #000b22; 
    margin-left: 2%; 
} 

.about h5 { 
    font-family: "Roboto"; 
    color: #3d4942; 
    margin-left: 2%; 
} 

#tc-wrap { 
    float: right; 
    width: 31%; 
    background-color: #fff; 
    height: 400px; 
    margin-top: 6%; 
    margin-right: 3%; 
} 

我不停的HTML一樣。這裏是result

相關問題