为什么李与50%的宽度和左浮动左侧不显示点 [英] Why li with 50% width and float left don't show dots on the left

查看:120
本文介绍了为什么李与50%的宽度和左浮动左侧不显示点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试创建2个列表,所以我使用:

I've try to create 2 colums list so I use:

ul {
   overflow: hidden;
}
ul li {
   float: left;
   width: 50%;
}

但是当我有两个项目,右边有一个列表项目符号和一个在左边不。为什么呢?

but when I have 2 items that one on the right have list bullet and the one on the left don't. Why is that?

PS:有办法有两列列表,而不使用:之前 c $ c> content:•

PS: is there a way to have 2 columns list without using :before with content: "•"

推荐答案

c $ c> overflow:hidden 也不是 display:inline-block 为我工作。

I had the same problem and neither overflow:hidden nor display: inline-block worked for me.

所以我在我的列表中的所有项目之前使用unicode编号为'bullet':•

So I cheated using the unicode number for 'bullet' before all items in my list: •

这绝对不是优雅,但在绝望的情况下会有诡计。

It's far from elegant, but does the trick in desperate situations.

这篇关于为什么李与50%的宽度和左浮动左侧不显示点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆