html - 列出数字和文本 css 之间的元素空间
问题描述
我将使用无序列表元素。在这里,我在项目符号和文本之间分隔或留出一些空间。它工作正常,但是当由于特定列表元素中的一些大句子而使用另一行的文本时,它没有使用空间。
ul {
list-style: none;
padding: 0;
margin: 0;
}
li {
padding-left: 56px;
}
li::before {
content: "•";
padding-right: 38px;
color: blue;
}
<ul>
<li>Password must have Alphabet, Numeral and Special Characters.Password must have Alphabet, Numeral and Special Characters</li>
<li>Password must have Alphabet, Numeral and Special Characters</li>
</ul>
如果无法理解,请告诉我。提前致谢。
解决方案
把 display:table 放在你的 li 和 li::before 添加 display: table-cell 可能对你有用
ul {
list-style: none;
padding: 0;
margin: 0;
}
li {
padding-left: 56px;
display: table;
}
li::before {
content: "•";
padding-right: 38px;
color: blue;
display: table-cell;
}
<ul>
<li>Password must have Alphabet, Numeral and Special Characters.Password must have Alphabet, Numeral and Special Characters</li>
<li>Password must have Alphabet, Numeral and Special Characters</li>
</ul>
推荐阅读
- html - iframe html 代码在表格中显示为纯文本
- c - 如何优化下面的代码以确定低于 1,000,000,000 的素数的总数在 C 中它们的数字之和等于 14?
- plugins - 需要帮助解决功能突出显示问题
- tomcat - Tomcat访问日志得到一个403请求,但是RequestDumperFilter看不到这个403请求的详细信息
- python - 标志着BERT编码器结束的层数是多少?
- javascript - 如何在 Cypress 中直接转换截图 Base64?
- sql - Redshift + Metabase - 如何设置查询队列以串行查询而不是并行查询?
- python - 有没有办法在优化器更新权重之前运行函数?
- python - 为什么我在查找对象 django 的 id 时得到 404
- ubuntu - 播放框架构建在 ubuntu 中不起作用