html - HTML 文档中列的顶部不均匀

标签 html css

我有一个 HTML <article>多列。第一列总是比其他列低 1/2 到 1 行。我试过去掉标题和其他所有东西以试图将其隔离,但显然我遗漏了一些东西。

<article id="Safety" style="padding-bottom: 40px;padding-top: 20px;padding-right:30px; padding-left: 50px;">
  <h3>Safety First: Prescription Safety Glasses</h3>
  <div style="column-count: 2; column-gap: 40px; padding-bottom: 20px; padding-right: 80px; ">
    <a href="https://my-benefits.ehr.com/US2/EN/myHealth/Vision/Pages/default.aspx" target="_blank"><img src="glasses.jpg" style="max-width: 100%; display: block; float: right; padding-left: 40px;"></a>
    <p>Some of my fellow eyeglass wearers may not be aware that Comcast will pay for you to have your prescription safety glasses fully covered! I recently became aware of this information and wanted to share it with all of you. Per our ComcastNow website,
      in the Vision Benefits SPD: Davis Vision will cover 100% of the cost, VSP- Safety Vision Glasses (Employee only) Coverage 100% after $20 copay; $75 Frame allowance. This helps us all, with the struggle of trying to wear two sets of glasses in order
      to see and be OSHA compliant while working in the field. More information can be found at <a href="https://my-benefits.ehr.com/US2/EN/myHealth/Vision/Pages/default.aspx">https://my-benefits.ehr.com/US2/EN/myHealth/Vision/Pages/default.aspx</a> regarding
      this great benefit. </p>
  </div>
  <a href="#contents" class="links">Back to Table of Contents</a>
</article>

最佳答案

您可以删除段落标记或向其添加 margin-top:0

<article id="Safety" style="padding-bottom: 40px;padding-top: 20px;padding-right:30px; padding-left: 50px;">
  <h3>Safety First: Prescription Safety Glasses</h3>
  <div style="column-count: 2; column-gap: 40px; padding-bottom: 20px; padding-right: 80px; ">
    <a href="https://my-benefits.ehr.com/US2/EN/myHealth/Vision/Pages/default.aspx" target="_blank"><img src="glasses.jpg" style="max-width: 100%; display: block; float: right; padding-left: 40px;"></a>
    <p style="margin-top:0">Some of my fellow eyeglass wearers may not be aware that Comcast will pay for you to have your prescription safety glasses fully covered! I recently became aware of this information and wanted to share it with all of you. Per our ComcastNow website,
      in the Vision Benefits SPD: Davis Vision will cover 100% of the cost, VSP- Safety Vision Glasses (Employee only) Coverage 100% after $20 copay; $75 Frame allowance. This helps us all, with the struggle of trying to wear two sets of glasses in order
      to see and be OSHA compliant while working in the field. More information can be found at <a href="https://my-benefits.ehr.com/US2/EN/myHealth/Vision/Pages/default.aspx">https://my-benefits.ehr.com/US2/EN/myHealth/Vision/Pages/default.aspx</a> regarding
      this great benefit. </p>
  </div>
  <a href="#contents" class="links">Back to Table of Contents</a>
</article>

关于html - HTML 文档中列的顶部不均匀,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46287002/

相关文章:

javascript - 有没有办法从 chrome 的存储图像中获取 url?

html - 填充不会在 html 中消失

javascript - 在动态创建的 div 问题中垂直居中文本

javascript - 显示/隐藏 div 并仍然使用内部内容 - HTML/JS

javascript - 在两个对象之间的 HTML5 Canvas 上绘制一个箭头

javascript - 使用javascript停止鼠标双击某些元素

php - 向 PHP 图片库添加描述标签

javascript - 脚本只会显示最后一个文本和最后一个颜色,但会按照指示进行动画处理,这是怎么回事?

html - CSS 相对最高百分比在 Chrome 中不起作用

css - 设置权重时的@font-face 问题