html - 溢出和列表样式类型不起作用

标签 html css

* {
    padding: 0;
    margin: 0;
}
.test {
    overflow: hidden;
    height: 50px;
    margin-left: 50px;
}

不显示 * 列表样式类型。 list-style-type如何用overflow和*样式显示?

jsfiddle:http://jsfiddle.net/hcFCs/

谢谢。

最佳答案

您必须将 padding-left 添加到 test 类。试试这个:

html:

<div class="test">
    <ul>
        <li>description</li>
        <li>description</li>
        <li>description</li>
        <li>description</li>
        <li>description</li>
        <li>description</li>
    </ul>    
</div>

CSS:

* {
    padding: 0;
    margin: 0;
}
.test {
    overflow: hidden;
    height: 50px;
    margin-left: 50px;
    padding-left:20px;
}

fiddle

关于html - 溢出和列表样式类型不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23821946/

相关文章:

javascript - React Material-UI GridList层叠布局

html - 如何让我的文本位于自定义复选框旁边的正确位置?

html - flex : Aligning align a button to the right and content to the left

javascript - 通过导航到 codeigniter 中的某个位置来下载创建的 pdf

css - (Flash) SimpleViewer 图片库的替代品?

jquery - 平滑背景图像的视差滚动

javascript - 将 float 的 div 粘贴到另一个元素的当前位置

javascript - 如何存储信息以正确显示构成单个游戏角色/对象/NPC 的多个图像?

css - 将行内 block DIV 对齐到容器元素的顶部

jquery - 简单的 css 选项卡式菜单提交未显示