带固定角的 3x3 桌子

发布于 2024-09-30 23:46:19 字数 181 浏览 3 评论 0原文

在这种情况下,我试图制作一个框架,一个 3x3 的桌子(使用 CSS),保持角的大小固定,并使桌子的其余部分根据内部的“单元格”拉伸。使用经典的表格可能会花费我不超过10分钟的时间,但是因为我过去遇到过表格问题*咳嗽*咳嗽IE*咳嗽我决定尝试使用div-s和span的CSS方式-但由于某种原因它显示不正确。

我可以给我一些提示吗?

I'm trying to make a frame in this case a 3x3 table (using CSS) keeping the corners fixed in size and making the rest of the table stretch according to the "cell" in the interior. Using the classic tables it would have probably took me no more than 10 minutes but because I've encountered problems with tables in the past *cough *cough IE *cough I've decided to try the CSS way using div-s and span-s but for some reason it just doesn't show right.

Can I have some hints?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故笙诉离歌 2024-10-07 23:46:19

我不确定我是否正确理解您的问题,但我认为您只是在寻找宽度为 33% 且有间隙 < 的

code>
每三行之后(或者您可以将每一行保留在它自己的包含 div 中):

CSS:

  .col {
    float: left;
    width: 33%;
  }

  /* color columns for clarity */
  .odd {
    background-color: #999;
  }

  .even {
    background-color: #666;
  }

HTML:

<div class="col odd">1</div>
<div class="col even">2</div>
<div class="col odd">3</div>
<br style="clear: both;" />
<div class="col even">4</div>
<div class="col odd">5</div>
<div class="col even">6</div>
<br style="clear: both;" />
<div class="col odd">7</div>
<div class="col even">8</div>
<div class="col odd">9</div>

这是您要寻找的吗?

I'm not sure I'm understanding your question right, but I think you're just looking for <div>s with 33% width, with a clearing <br /> after every three (or you could keep each row in a containing div of it's own):

CSS:

  .col {
    float: left;
    width: 33%;
  }

  /* color columns for clarity */
  .odd {
    background-color: #999;
  }

  .even {
    background-color: #666;
  }

HTML:

<div class="col odd">1</div>
<div class="col even">2</div>
<div class="col odd">3</div>
<br style="clear: both;" />
<div class="col even">4</div>
<div class="col odd">5</div>
<div class="col even">6</div>
<br style="clear: both;" />
<div class="col odd">7</div>
<div class="col even">8</div>
<div class="col odd">9</div>

Is that what you're looking for?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文