如何将我的所有li在一条线? [英] how to align all my li on one line?

查看:113
本文介绍了如何将我的所有li在一条线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的CSS

ul{
overflow:hidden;
}
li{
display:inline-block;
}

我的HTML

<ul>
<li>a</li>
<li>b</li>
<li>c</li>
<li>d</li>
<li>e</li>
<li>f</li>
<li>g</li>
</ul>

我想将所有li项对齐在一行,如果我做的一切正常,当3或4 li填充我的身体的第一行,他们去第二行,我希望他们在1行,1行之后的一切都将被隐藏

i want to align all my li items in one line, if i did that everything works fine except that when 3 or 4 li's fills the first line on my body they go the the second line, i want them to be on 1 line and everything after the 1 line is filled will be "hidden"

FOR示例::

//注意li不仅包含1个字母的句子

// NOTE li holds sentences not just 1 letter

OUTPUT NOW ::

OUTPUT NOW ::

a               b                c              d
      e                  f               g

DESIRED OUTPUT ::

DESIRED OUTPUT ::

a                 b              c              d         e      f  //all of them in 1 line and the rest of them are hidden 'overflow:hidden'


推荐答案

< ul> 样式

编辑:使用'inline',而不是像其他人指出的那样'inline-block'(我忘了)

edit: and use 'inline' rather than 'inline-block' as other have pointed out (and I forgot)

这篇关于如何将我的所有li在一条线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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