Gap between <li>s

做~自己de王妃 提交于 2019-12-05 05:24:08

With css3 you can add columns to your lists

ul.gmc-ingredient-list {
    margin: 0;
    padding:0;
    -moz-column-count: 2;
    -moz-column-gap: 0;
    -webkit-column-count: 2;
    -webkit-column-gap: 0;
    column-count: 2;
    column-gap: 0;
    width:300px;
}
ul.gmc-ingredient-list li {
    background: url(http://allesoveritaliaanseten.nl/wp-content/uploads/2012/11/aoie-list.png) no-repeat scroll left top transparent;
    list-style: none outside none;
    padding: 0px 0 0 20px;
    width:130px;
}

don't forget to remove the float from the li

Example: http://jsfiddle.net/LWBdp/3/

IE Problems CSS columns don't seem to work for IE, if you leave the float:left in there it will look like you had in IE but will look better in the other browsers!

For more information about css-columns take a look at this article at w3schools

I would recommend you using http://www.csscripting.com/css-multi-column/

I use this script for a long time now and it's really efficient compared to other possibilities available. If your site is done with AJAX, you will have to modify this line: ut.XBrowserAddEventHandler(window,'load',function() { documentReady = true; processElements(); } );

EDIT: This solution is working on any browser since IE6...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!