Css,li全宽度为ul

时间:2016-06-08 13:52:06

标签: css list

我正在尝试制作一个无序列表,其中li元素跨越其父ul的整个宽度。 例如,使用浏览器检查以下代码:

    Rewritecond %{HTTP_HOST} ^example\.com
    RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # Removes index.php from ExpressionEngine URLs
    RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
    RewriteCond %{REQUEST_URI} !/system/.* [NC]
    RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

    # Directs all EE web requests through the site index file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]

您将看到li元素不是100%的行。你对如何解决这个问题有什么建议......

enter image description here

黄色的东西是ul,文字开始就像右边的50px。

1 个答案:

答案 0 :(得分:3)

列表项(<li>)占用了他们所占空间的100%。它是padding上的默认<ul>你&# 39;重看。使用ul {padding:0}

删除它

&#13;
&#13;
ul {padding:0}
&#13;
<ul>
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
</ul>
&#13;
&#13;
&#13;

相关问题