【发布时间】:2018-10-03 22:13:34
【问题描述】:
我想在这些 div 元素之间添加间距。 我该怎么做?
<div style="clear: left;">
<p class="image"><img src="https://blog.proven.com/wp-content/uploads/zipsqaure.jpg" height="200" width="200" border="1px"></p>
<p class="rating"><strong><font size="4">Proven Rating: <font color="#0077b3">★★★★★</font></font></strong></p>
<p class="description">ZipRecruiter allows employers to post jobs within minutes and reach over 200 million active job seekers. </p>
</div>
<div style="clear: left;">
<p class="image"><img src="https://blog.proven.com/wp-content/uploads/snag-1.png" height="200" width="200" border="1px"></p>
<p class="rating"><strong><font size="4">Proven Rating: <font color="#0077b3">★★★★★</font></font></strong></p>
<p class="description">Snagajob allows employers to reach over 80 million job seekers through their job board. It was founded in 1999 and continues to be one of the top job boards today, hosting one of the largest hourly employee networks on the web.</p>
</div>
【问题讨论】:
-
什么是“间距”?也许是保证金?
-
你想要两个 div 之间的空间,还是 div 内所有元素之间的空间?
-
最好的做法是将单个类添加到您想要设置样式的元素中,而不是使用嵌套选择器,这会让您陷入特异性陷阱css-tricks.com/specifics-on-css-specificity