使用CSS删除ul缩进 [英] Removing ul indentation with CSS
问题描述
当列表中的长行环绕时,我似乎无法从无序列表中删除缩进.这是我的清单:
I cannot seem to remove the indent from my unordered list when long lines in my list wrap around. Here is what my list looks like:
- Windows用户可以使用腻子
- Mac用户可以使用Terminal.app
- Linux用户可以使用SSH userid@ourserver.com端口22
- .........>或使用像Cyber duck这样的SFTP程序将其指向 ..................................................> ourserver.com,端口22
- Windows users can use putty
- Mac users can use the Terminal.app
- Linux users can use SSH userid@ourserver.com port 22
- ...........>Or use an SFTP program like Cyberduck just point it at .........................................>ourserver.com, port 22
(点表示缩进)
我已经阅读了很多解决方案,并尝试使用文本缩进,列表样式将边距和填充设置为零,但是没有任何效果.我认为问题在于列表上方有一个标题,我需要将其居中,因此我将边距设置为自动,然后将下面的列表弄乱了.但是,即使我在父div内放了两个div也没用.
I've read a bunch of solutions and tried setting margin and padding to zero, using text-indent, list-style, but nothing works. I think the problem is that there is a heading above the list that I need to be centered and so I'm setting the margins to auto and then it's messing up the list below. But even if I put say two divs inside the parent div it doesn't work.
这里是HTML/CSS(如果有某些设置导致所有其他解决方案均失败,我会提供所有内容)
Here is the HTML/CSS (I included everything in case there is some setting that is causing all of the other solutions to fail)
<div id="info">
<p><strong>Did you know you can SSH directly to ourserver.com?</strong> </p>
<ul>
<li>Windows users can use putty</li>
<li>Mac users can use the <a href="http://www.terminfo.org">Terminal.app</a></li>
<li>Linux users can use SSH userid@ourserver.com port 22</li>
<li>Or use an SFTP program like <a href="http://cyberduck.ch/">Cyberduck</a> just point it at ourserver.com, port 22</li>
</ul>
</div>
#info {
color:#FFFFFF;
width:440px;
margin-left:auto;
margin-right:auto;
border-radius: 10px;
border-style:solid;
border-width:2px;
border-color:#FFF;
padding-bottom:20px; padding-left:20px; padding-right:20px;
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#333333), to(#cccccc));
overflow: hidden;
}
#info ul li {
float:left;
}
推荐答案
此代码将删除缩进并列出项目符号.
This code will remove the indentation and list bullets.
ul {
padding: 0;
list-style-type: none;
}
这篇关于使用CSS删除ul缩进的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!