css - 列表li与li之间的间距怎么设置?
天蓬老师
天蓬老师 2017-04-17 14:41:22
0
5
2096


如上图所示,这个是使用appcan开发的移动app, 图中的li是使用Listview列表组件写的,代码如下:

<p id="listview">  </p>

var updateData = [{
            title : "上海教育体系被赞世界最强之一教师是教育质 量的核心",
            note : "2016-01-01",
            icon : "img/icon_01.png"
        }, {
            title : "上海教育体系被赞世界最强之一教师是教育质 量的核心",
            note : "2016-01-01",
            icon : "img/icon_02.png"
        }];
        var lv1 = appcan.listview({
            selector : "#listview",
            type : "thickLine",
            hasIcon : true,
            hasAngle : false
        });
        lv1.set(updateData);

这个列表加了margin来设置li与li之间的间距,不起作用。

要达到如下图所示的效果,ulbackground-color是灰色的,libackground-color是白色的,li是有边框的, 上个li的下边框与下个li的上边框 之间是有空隙的。

请问,如何用css设置这种 lili 边框 之间的空隙?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(5)
Ty80

I found the cause of the problem. It’s not that margin doesn’t work, but that background-color:#fff is written incorrectly, and ul also has a white background
-_-||| @_@

Thank you all for your responses. . .

ps: It took a long time to make trouble but it was an own mistake. . . I really want to find a crack in the ground and crawl into it. . . Cover your face. . . .

大家讲道理

Margin is the outer margin. Isn’t this enough?

This is no problem either

Looked at the one downstairs. I’ll post another padding for you

左手右手慢动作

Can’t I just set the margin of the middle li?

迷茫

https://jsfiddle.net/n60rkeka/1/

PHPzhong

Just set margin. But you haven’t adopted the above answer. Is it because you don’t understand your needs and how to get it?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template