Css 如何设计<;李>;内部项目<;ul>;?
我想做像这里这样的项目 我是用UL做的。这是我的密码 但我不知道为什么第四项有更大的利润左选择。。。它应该和第一项在同一位置,但在第二行。有人能帮我吗? 你把保证金放在左边:19像素在李的,而不是保证金右边 左边距导致第四行距离左边距一定距离Css 如何设计<;李>;内部项目<;ul>;?,css,styles,html-lists,Css,Styles,Html Lists,我想做像这里这样的项目 我是用UL做的。这是我的密码 但我不知道为什么第四项有更大的利润左选择。。。它应该和第一项在同一位置,但在第二行。有人能帮我吗? 你把保证金放在左边:19像素在李的,而不是保证金右边 左边距导致第四行距离左边距一定距离 ul.gallery_items{ width: 831px; height: auto; margin: 0 auto; list-style: none; } ul.gallery_items li{
ul.gallery_items{
width: 831px;
height: auto;
margin: 0 auto;
list-style: none;
}
ul.gallery_items li{
width: 260px;
height: 200px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
border: 2px solid #e5e5e5;
float: left;
margin-top: 25px;
margin-right: 19px;
}
ul.gallery_items li:first-child{
margin-top: 25px;
margin-left: 0px;
}
你把保证金放在左边:19像素在李的,而不是保证金右边
左边距导致第四行距离左边距一定距离
ul.gallery_items{
width: 831px;
height: auto;
margin: 0 auto;
list-style: none;
}
ul.gallery_items li{
width: 260px;
height: 200px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
border: 2px solid #e5e5e5;
float: left;
margin-top: 25px;
margin-right: 19px;
}
ul.gallery_items li:first-child{
margin-top: 25px;
margin-left: 0px;
}
您明确地为第一项指定了不同的左边距:
ul.gallery_items li:first-child{
margin-left: 0px;
}
ul.gallery_items li{
margin-left: 19px;
}
您明确地为第一项指定了不同的左边距:
ul.gallery_items li:first-child{
margin-left: 0px;
}
ul.gallery_items li{
margin-left: 19px;
}
第4项与其他项具有相同的边距,您刚刚从第一项中删除了边距:
ul.gallery_items li:first-child{
margin-top: 25px;
margin-left: 0px;
}
第四元素似乎有问题
marginright
而不是marginleft
marginleft:0
,并将marginleft:-19px
赋给父元素第4项与其他项具有相同的边距,您刚刚从第一项中删除了边距:
ul.gallery_items li:first-child{
margin-top: 25px;
margin-left: 0px;
}
第四元素似乎有问题
marginright
而不是marginleft
marginleft:0
,并将marginleft:-19px
赋给父元素ul.gallery_items li:first-child{
margin-top: 25px;
margin-left: 0px;
}
这就是为什么第一项并没有留下空白
这应该可以做到
你已经申请了
ul.gallery_items li:first-child{
margin-top: 25px;
margin-left: 0px;
}
这就是为什么第一个项目没有留下空白的原因是的,这对我很有帮助。愚蠢的脑袋认为应该留着空白。谢谢你,这对我有帮助。愚蠢的脑袋认为应该留着空白。谢谢