html - 并排 <div> 然后是常规 <div>

标签 html css css-float

HTML 和 CSS 让我变得谦逊:

试图模仿以下内容: enter image description here

这是我的尝试:

<div>
  <div style="width:800px;">
    <div style="float:left;width:25%;background-color:red;">Facility #: COMPANY10</div>
    <div style="float:left;width:50%;background-color:green;text-align:center;">FACILITY_112</div>
    <div style="float:left;width:25%;background-color:blue;text-align:right;">Facility Code: 4071</div>
  </div>
  <div style="width:800px;">
    <div style="float:left;width:25%;background-color:red;">Date: Jul 17, 2014</div>
    <div style="float:left;width:50%;background-color:green;text-align:center;">Custom Assessment (UDA) Report</div>
    <div style="float:left;width:25%;background-color:blue;text-align:right;">User: John Wayne</div>
  </div>
  <div>
    Time: 12:59:11 ET
  </div>
  <div>
    <hr/>
    Assessment Type: 1 - Braden Scale for Predicting Pressure Sore Risk
    <hr/>
  </div>
</div>

这导致: enter image description here

我该如何解决这个问题,请帮忙。

最佳答案

只需限制最外层的宽度<div>也到 800px。

关于html - 并排 <div> 然后是常规 <div>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24811949/

相关文章:

html - 可以 float 在任意后续内容上的简单 CSS 菜单

html - CSS 底部边框和 float

css - Chrome 25 : Empty style tag at the end of every page

php - 确保浏览器一次显示所有内容

html - 将 "?v=1"附加到链接和脚本标记中的 CSS 和 JavaScript URL 有什么作用?

html - Unicode 作为元素符号不缩进第二行

css - 如何删除数据表分页按钮中的空格

css - 每三个帖子摘录出现在自己的行中

html - 图像标题(文本)与图像一起显着缩小

html - 如何让不同的图像显示在不同屏幕尺寸的 jQuery slider 插件中?