简体   繁体   English

子弹ul li下面的测试包装

[英]test wraps below bullet ul li

As a requirement at work, I have to use someone's stylesheet and I'm having trouble trying to override one behavior. 根据工作要求,我必须使用某人的样式表,并且在尝试覆盖一种行为时遇到麻烦。 The unordered list elements <li> are having text that exceeds 1 line wrap around to the area below the bullet point. 无序列表元素<li>的文字在项目符号点下方的区域内环绕超过1行。 Here's the CSS that is causing the behavior: 这是导致此行为的CSS:

ul
{
  list-style: none;
  list-style-position: inside;
  padding: 0;    
}

li 
{
  list-style-type: disc;
  list-style-image: none;
  margin-left:0px;
  margin-bottom: 5px;
} 

Here's a fiddle for that: http://jsfiddle.net/CP32B/1/ 这是一个小提琴: http : //jsfiddle.net/CP32B/1/

What attribute do I need to override so that I can get the text to align like it does by default? 我需要覆盖什么属性,以便可以像默认情况下一样对齐文本? (Example of default behavior: http://jsfiddle.net/B5jPH/ ) (默认行为示例: http : //jsfiddle.net/B5jPH/

list-style-position: inside; is the property which causes that behavior and inorder to fix that, you need to use outside 是导致该行为的属性,为了解决该问题,您需要在outside使用

Demo 演示

Applying padding:0 with list-style-position: inside; padding:0应用于list-style-position: inside; is hiding the bullets. 隐藏子弹。

You can left align the bullets without text flowing below it by changing it to the following 您可以将项目符号更改为以下内容,以使项目符号左对齐,使其下方没有文本

ul
{ 
 padding-left:10px;
}

JSFiddle 的jsfiddle

ul { list-style-position: outside !important; ul {list-style-position:outside!important; padding-left: 2em !important; padding-left:2em!important;
} }

!important will override the css !important将覆盖CSS

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM