如何将UL列表样式化为单行 [英] How to style the UL list to a single line

查看:152
本文介绍了如何将UL列表样式化为单行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在一行中呈现此列表。

I want to render this list in a single line.


  • 列出item1

  • item2
  • List item1
  • List item2

应显示为

*列表项2 *列表项2

*List item2 *List item2

使用什么CSS样式?

推荐答案

ul li{
  display: inline;
}

有关更多信息,请参阅基本列表选项一个基本水平列表。 (感谢以下链接的 Daniel Straight )。

For more see the basic list options and a basic horizontal list at listamatic. (thanks to Daniel Straight below for the links).

另外,正如评论中指出的,你可能需要在ul和li中的任何元素的样式,以及li的自身,以使事情看起来不错。

Also, as pointed out in the comments, you probably want styling on the ul and whatever elements go inside the li's and the li's themselves to get things to look nice.

这篇关于如何将UL列表样式化为单行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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