如何为html UL列表启用水平滚动条 [英] How to enable horizontal scroll bar for html UL list

查看:770
本文介绍了如何为html UL列表启用水平滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下css为我的列表。我可以看到水平滚动条,但其禁用。如何启用它?

I have following css for my list. I can see the horizontal scroll bar but its disabled. How to enable it?

 .li {
  position: absolute;
  z-index: 10; 
  list-style: none; 
  margin: 0;
  padding: 2px; 
  max-height: 20em; 
  overflow-y: scroll;
  overflow-x: scroll;

  }

 .ul {
   margin: 0;
   padding: 0 4px;
   border-radius: 2px;
   max-width: 10em;

   white-space: nowrap;
   color: black;
   cursor: pointer; 

   }

请帮助

推荐答案

为什么写.li和.ul?除非这些是列表元素的类名,否则它们应该是li和ul(没有句点),或者是相应的li和ul元素的类名。

Why did you write ".li" and ".ul"? Unless these are your class names for the list elements, they should either just be "li" and "ul" (without the periods), or be the class names of the respective "li" and "ul" elements.

这篇关于如何为html UL列表启用水平滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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