如何关闭两个元素之间的空间

时间:2015-06-19 19:40:00

标签: html

我试图缩小我的前两个元素(一个h1标签和一个包含在链接标签中的图像标签)之间的差距。

我试过改变边距和漂浮......我被卡住了:(

<div align="center">
    <h1 style="color:blue; background-color:lightgrey; font-size:100px;">Inner Planets - Museum</h1>

    <a href="http://csc2.madonna.edu/~brabahy/hw5/museum.html"><img src="http://csc2.madonna.edu/~brabahy/hw5/images/Banner1.jpg" height="400" width="1250"></a>
</div>

1 个答案:

答案 0 :(得分:0)

另一种样式为h1元素以封闭空间。

以h1的风格添加 margin-bottom:10px

 <h1 style="color:blue; background-color:lightgrey; margin-bottom:10px; font-size:100px;">Inner Planets - Museum</h1>

这是一个同样的掠夺者 - http://plnkr.co/edit/1zvOxIar7RQOVcwmKV7B?p=preview

相关问题