html - 我可以创建这样的 HTML 设计吗?

标签 html css

我可以像这里的解决方案一样创建 HTML 设计吗:
HTML and CSS align divs between a line

但不使用位置属性。我正在使用表格,但无法设计内部 DIV。
请指教。 attached image

最佳答案

看看这个

table {
  width: 500px;
  background: #2A3F50;
  margin: 40px 0px;
}

table tr td {
  padding: 10px;
}

table tr td div {
  background: #1BBC9D;
  padding: 20px;
  margin-top: -30px;
  margin-bottom: -30px;
  color: white;
}
<table>
  <tr>
    <td>
      <div>
        <h3>Do you know?</h3>
        <p>Over the past 12 weeks, most product sales for <b>Combisunate 20/120 Tablets 2</b> was on <b>Weednesday Jul 12, 2017</b>b>
        </p>
        <p>
          On that day, most verification came between <b>9AM</b> and <b>10AM UTC</b>
        </p>
      </div>
    </td>
    <td><img src="http://icons.iconarchive.com/icons/zhoolego/material/512/Folder-Doc-icon.png" width="100px" /></td>
  </tr>
</table>

关于html - 我可以创建这样的 HTML 设计吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47427852/

相关文章:

Python - 如何逐行读取 HTML

pseudo-element - CSS 虚线阴影

html - 100% 宽度页眉和页脚

html - 为什么 "height: auto;"在我使用 "float:left"时不起作用?

javascript - 在我的 ul 列表中查找并分隔带有单词首字母的单词?

javascript - 我的 Jquery/Javascript 无法连接! - 在 HTML 中工作 - 编程新手

html - 为视网膜显示设置特定样式表

html - 具有宽度的常规段落下方的右浮动元素

html - firefox 在黑框中显示图像

javascript - 使 JavaScript 代码适用于任何元素