CSS 列表问题

标签 css list

如何解决我的 css 列表问题,形成在 div 标签内显示的文本。

# ordered lists - the 
list items are marked with numbers or letters

在 div 标签内时这样显示。

# ordered lists - the 
  list items are marked with numbers or letters.

这是 html。

        <div>
            <h2>header</h2>
                <ul>
                    <li>ordered lists - the list items are marked with numbers or letters</li>
                    <li>ordered lists - the list items are marked with numbers or letters</li>
                </ul>
        </div>

CSS。

div {
    margin: 0px 0px 15px 0px;
    padding: 0px 0px 5px 0px;
    background: #fff;
    float: right;
    width: 302px;
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border: 3px solid #fff;
}

div h2 {
    text-indent: 10px;
    margin: 0px;
    padding: 5px 0px 5px 0px;
    font-size: 1.4em;
    width: 302px;
    color: #fFF;
    border-bottom: 1px dotted #fff;
}

div ul {
    padding: 0px;
    margin: 0px;
    line-height: 20px;
    width: 308px;
}

div li {
    list-style-position: inside;
    border-bottom: 1px solid #fff;
    padding: 5px 10px;
    margin: 0px;
    width: 282px;
    color: #ffffff;
}

最佳答案

第一个是list-style-position: inside,另一个是list-style-position: outisde和一些padding。

关于CSS 列表问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3699017/

相关文章:

Python 函数参数 : tuple/list

python - 检查项目符号点是否在列表中

angularjs - 用逗号分隔符分隔 ng-message

javascript - 如何通过 Angular 将鼠标悬停在另一个元素上时添加和删除一个元素的类?

python - MySQL 错误 - 错误 1054 : Unknown column in 'where clause'

python - 使用 python3 查找数字列表中的第二大数字

r - 从 r 中的数据帧中制作大小为 n/2 和 2 列的列表

css - 为什么我的下拉菜单没有出现?

css - 使用 Bootstrap Tour 时禁用突出显示的区域

javascript - 从下拉菜单选项中显示 "title"标签