CSS3 列数属性

发布于 2024-12-15 10:34:17 字数 793 浏览 6 评论 0原文

我有以下简短的 css 代码

 div#mydiv{
  border-style: none; 
  margin-bottom: 1em;
  background-color: #F6F6F6;
  color: #000;
  padding-top: 20px;
  padding-bottom: 20px;
  text-align: justify;
  column-width: 15em;
  column-gap: 2em;
  column-count:2;
  -moz-column-width: 15em;
  -moz-column-gap: 2em;
  -moz-column-count:2;
  -webkit-column-count:2;
  -webkit-column-width: 15em;
  -webkit-column-gap: 2em;   
  box-shadow: #ccc 0 0 15px;
  }

现在,在 Firefox 上它工作得很好并且显示 2 列文本。在 Opera 上这是可行的,但它非常奇怪,它不是显示 2 列文本,而是显示 3 列!

所以火狐浏览器:

bla bla
布拉布拉
布拉布拉
布拉布拉
bla bla

歌剧

bla bla bla
布拉布拉布拉
bla bla bla

资源管理器

blablablablablablabla

我想知道 Opera 有什么问题以及是否有办法让资源管理器在列中显示文本。

谢谢

i've the following short css code

 div#mydiv{
  border-style: none; 
  margin-bottom: 1em;
  background-color: #F6F6F6;
  color: #000;
  padding-top: 20px;
  padding-bottom: 20px;
  text-align: justify;
  column-width: 15em;
  column-gap: 2em;
  column-count:2;
  -moz-column-width: 15em;
  -moz-column-gap: 2em;
  -moz-column-count:2;
  -webkit-column-count:2;
  -webkit-column-width: 15em;
  -webkit-column-gap: 2em;   
  box-shadow: #ccc 0 0 15px;
  }

Now, on Firefox this work great and show 2 columns of text. On Opera this works but it is super weird, instead of showing 2 columns of text, it shows 3 columns!

so firefox:

bla bla
bla bla
bla bla
bla bla
bla bla

Opera

bla bla bla
bla bla bla
bla bla bla

Explorer

blablablablablablabla

I would like to know what is wrong with opera and if there is a way to have explorer show text in columns.

thank you

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

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

发布评论

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

评论(1

下壹個目標 2024-12-22 10:34:17

css3有什么原因吗?如果没有,您可以简单地使用 css 来完成此操作,例如:

#container {
    width:800px;
}

#left {
    float:left;
    width:400px;
}
#right {
    float:right;
    width:400px;
}

Html:

<div id="container">
<div id="left">..</div>
<div id="right">..</div>
</div>

代码可能不完全正确,只是为了给您提供示例。

Is there any reason for css3? If not, you can do this simply with css like:

#container {
    width:800px;
}

#left {
    float:left;
    width:400px;
}
#right {
    float:right;
    width:400px;
}

And

Html:

<div id="container">
<div id="left">..</div>
<div id="right">..</div>
</div>

Code might not be exacly right, just to give you example.

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