因此,我一直试图删除我的div元素和iframe之间的空间,一个小时都没有成功。任何帮助都将不胜感激。到目前为止,这就是我所做的。
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元素之间的空白。
<!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>发布于 2016-10-25 16:07:21
您需要从<h1>标记中删除默认页边距,所有HTML标题都具有默认的页边距样式。
h1{
text-align: center;
color: white;
margin: 0;
}https://stackoverflow.com/questions/40244698
复制相似问题