通过列数控制分布
问题:http://www.offprint.am/0811861538/
有没有办法阻止该内容包含在单个 p /p 中,以免在列之间拆分?将它包含在 div 中并赋予它高度属性似乎可行,但我正在寻找更通用的东西/不是逐个条目的基础。
理想情况下,除非有大量文本(http://www.offprint.am/wp/3836516861/),否则我希望描述位于左侧,信息位于右侧。我可以在列容器外部使用两个 div (float:left) 来完成此操作,但我很难让它们居中。
后者(带 div)将是首选解决方案,但我会立即寻求任何帮助。
另外:
.entry 是带有列计数等的主要容器。为了解决浮动问题,我制作了两个容器(.desc 和 .info)display: block; float:left 并从 .entry 借用了 border/spacing 属性 (.desc padding-right:30px; border-right: 1px dashed #eee; / .info padding-left: 30px;)
虽然它做了我想要的事情大多数情况下,它根本不会居中。
ISSUE: http://www.offprint.am/0811861538/
Is there a way to prevent the content contained within a single p /p from being split between columns? Containing it within a div and giving it a height property seems to work, but I'm looking for something a little more versatile/not on an entry by entry basis.
Ideally, unless there's a HUGE amount of text (http://www.offprint.am/wp/3836516861/) I want the description to be on the left and the information to be on the right. I was able to do this with two divs (float:left) outside of the column container, but I struggled to get them centered.
The latter (w/ divs) would be the preferred solution, but I'll take any help I can get right now.
Aside:
.entry is the main container w/ column-count et al. For the float work around, I made two containers (.desc & .info) display: block; float:left and borrowed the border/spacing properties from .entry (.desc padding-right:30px; border-right: 1px dashed #eee; / .info padding-left: 30px;)
Although it did what I wanted it to for the most part, it simply wouldn't center.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从
.entry
中删除以下内容:添加 add
overflow: hide;
然后将
.entry p
修改为:同时添加以下内容:
。条目.info {
浮动:向左;
宽度:300px;
}
remove from
.entry
the following:add add
overflow: hidden;
Then modify
.entry p
to:also add the following:
.entry .info {
float: left;
width: 300px;
}