html - hr没有覆盖图像

标签 html css

这是一个有 2 行的表格。第一行包含一个 hr。第二个表行包含文本和图像。为什么 hr 不同时覆盖图像和文本?

        <table>
            <tr>
                <td align="center">
                    <hr class="hr">
                </td>
            </tr>
            <tr align="center">
                <td width="60%" align="center">
                    <p>
                    Every occasion should be a special one!  No matter the event, a custom-designed cake always adds that special something. 

                    Weddings, birthdays, baby showers, an anniversary...  for ANY event, large or small, let me help you celebrate with a delicious and beautifully-designed and decorated cake!

                    Please take a look through my Cake Photo Gallery to see some of the work I've done recently.

                    Anytime Cakes!  Any cake, any style, any time!!

                    Enjoy!

                    ...Andrea
                    </p>
                </td>
                <td width="40%" align="center">
                    <img src="images/homeimg.jpg">
                </td>
            </tr>
        </table>

最佳答案

第二行有两个单元格,第一行只有一个。将 colspan="2" 添加到第一个 td 以使其成为两列宽:

<table>
  <tr>
    <td align="center" colspan="2">
      <hr class="hr">
    </td>
  </tr>
  <tr align="center">
    <td width="60%" align="center">
      <p>
        Every occasion should be a special one! No matter the event, a custom-designed cake always adds that special something. Weddings, birthdays, baby showers, an anniversary... for ANY event, large or small, let me help you celebrate with a delicious and
        beautifully-designed and decorated cake! Please take a look through my Cake Photo Gallery to see some of the work I've done recently. Anytime Cakes! Any cake, any style, any time!! Enjoy! ...Andrea
      </p>
    </td>
    <td width="40%" align="center">
      <img src="images/homeimg.jpg">
    </td>
  </tr>
</table>

关于html - hr没有覆盖图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42821511/

相关文章:

javascript - Google Charts HTML 工具提示里面有 javascript onclick 事件吗?

html - 菜单项显示不正确

css - 如果我在路由中使用媒体 : Ember. inject.service() ,则 template.hbs 中的 ember 响应式 {{media}} 是未定义的。为什么?

javascript - 显示不同的 Logo

html - 尝试为网站创建 css 样式(Bootstrap)

JavaScript onChange 处理程序错误

Javascript 选项更改头部 style.css

html - 如何将内容放入 Div 容器

css - 嵌套带下划线的文本元素

css - 如何在 IE 8 及更早版本中显示溢出内容的垂直滚动条?