html - 如何制作2行8列的CSS

标签 html css

  • 如何在 CSS 中制作 2 行 8 列的表格? 注意:表格必须有严格的位置,

    我制作了 2 行 8 列的表格,并且 我将文本模块添加到每个列,然后将 HTML 代码添加到 控制文本行为的每个文本模块 模块并将文本模块转换为可编辑的 HTML 列 任何拖放网站构建器插件。所以我在这方面取得了成功 现在问题是所有列都显示在行中我的意思是现在 我有 8 行,每行有 1 列。这发生在我 将 HTML 代码添加到每个文本模块。这是简短的 html 我添加到每个文本模块以将文本模块转换为 可编辑的列。

HTML > The same code is added to all Text Modules... Total Text modules are 8

文本模块 1

   <div id="main-section2"></div>
    <div class="bg-wrapper-cover">
      <div class="row2">
        <div class="col-text-0"></div>
        <div class="bg-wrapper-cover-background"></div>
</div>

文本模块 2

   <div id="main-section2"></div>
    <div class="bg-wrapper-cover">
      <div class="row2">
        <div class="col-text-0"></div>
        <div class="bg-wrapper-cover-background"></div>
</div>

CSS:

#main-section2
.bg-wrapper-cover {
  width:500px;
  position:relative;
}
.row2 {
  display: flex;
  width:100%;
  margin:0px;
}



.col-text-0 {
  padding:0 14px;
  border:1px solid black;
  display:inline-block;
  width:calc(25% - 30px);
  height:50px;
  background:pink;
  z-index:10;
}

.bg-wrapper-cover-background {
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:100%;
  z-index :0;
  transition: background 3s;
}

.bg-wrapper-cover:hover .col-text-0 {
  background:none;
}
.bg-wrapper-cover:hover .col-text-0:hover {
  background:red;
}
.bg-wrapper-cover:hover .row2:nth-child(1) .col-text-0:nth-child(1):hover ~ .bg-wrapper-cover-background {
  background:blue;
  z-index:0;
}

.bg-wrapper-cover:hover .row2:nth-child(1) .col-text-0:nth-child(3):hover ~ .bg-wrapper-cover-background {
  background:darkgray;
  z-index:0;
}
.bg-wrapper-cover:hover .row2:nth-child(1) .col-text-0:nth-child(5):hover ~ .bg-wrapper-cover-background {
  background:yellow;
  z-index:0;
}
.bg-wrapper-cover:hover .row2:nth-child(1) .col-text-0:nth-child(7):hover ~ .bg-wrapper-cover-background {
  background:orange;
  z-index:0;
}
.bg-wrapper-cover:hover .row2:nth-child(2) .col-text-0:nth-child(1):hover ~ .bg-wrapper-cover-background {
  background:gray;
  z-index:0;
}

.bg-wrapper-cover:hover .row2:nth-child(2) .col-text-0:nth-child(3):hover ~ .bg-wrapper-cover-background {
  background:black;
  z-index:0;
}
.bg-wrapper-cover:hover .row2:nth-child(2) .col-text-0:nth-child(5):hover ~ .bg-wrapper-cover-background {
  background:green;
  z-index:0;
}
.bg-wrapper-cover:hover .row2:nth-child(2) .col-text-0:nth-child(7):hover ~ .bg-wrapper-cover-background {
  background:lightblue;
  z-index:0;
}

SNAPSHOT

最佳答案

为什么不只是具有以下样式的无序列表:

li:nth-child(2n) {
  margin-bottom: 10px;
}

关于html - 如何制作2行8列的CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53288531/

相关文章:

css - 顶部分区的溢出影响其下方分区的属性

html - ASP.NET MVC 应用程序,<text> 标记

html - CSS : border-radius and color not respected within table

c# - 当鼠标悬停在 'Edit' 链接上时,Gridview 中的 CSS Frozen Header 会向上滚动

javascript - 当不再选择值时反转更改(指定 ID)

javascript - WooCommerce 注册国家选择

php - 如何使用 id 获取多个值并将其存储在变量中

css - 为什么只有某些 div 相互重叠?

javascript - 当浏览器宽度减小时减小图像宽度

php - 使用 HTML/CSS 发送 PHP 电子邮件