2016-10-25 2 views
1

私はdiv要素とiframe間のスペースを1時間無駄にしています。どんな助けでも大歓迎です。これは私がこれまで行ってきたことです。iframe要素とdiv要素の間のスペースをすべて削除するにはどうすればよいですか?

CSS:

h1 { 
    text-align: center; 
    color: white; 
} 

.d1 { 
    border-style: none; 
    background-color: blue; 
} 

iframe { 
    width: 50%; 
    height: 50%; 
    display: block; 
    margin: 0; 
} 

ここでは私のhtmlです:私は、上部と下部の2のdiv要素の間に空白を取り除くためにしようとしています。あなたは<h1>タグからデフォルトのマージンを削除する必要が

<!DOCTYPE html> 
<!-- By Christian Soto --> 
<html> 
    <head> 
     <meta charset="UTF-8"> 
     <title>Event Driven JS</title> 
     <link rel="stylesheet" type="text/css" href="index.css"> 
    </head> 
    <body> 
     <div class="d1"> 
     <h1>Using JavaScript to Change the HTML</h1> 
     </div> 
     <iframe id="section"> 
     <!-- Will be loading different html pages into here --> 
     </iframe> 
     <div class="d1"> 
     <h1>Christian Soto</h1> 
     </div> 
    </body> 
</html> 
+0

あなたの問題を示すjsfiddleを提供することができます。 – Steve

答えて

2

、 すべてHTML headingsは、デフォルトのマージンのスタイルを持っています。

h1{ 
text-align: center; 
color: white; 
margin: 0; 
} 
+0

ああ、そこにあります。大変感謝しています。 –

関連する問題