HTML片段:
<li class = "li_image"></li>
Run Code Online (Sandbox Code Playgroud)
CSS片段:
li_img {
width:28px;
height:32px;
background:url(https://ssl.gstatic.com/gb/images/v1_90902864.png) 10 15;
}
Run Code Online (Sandbox Code Playgroud)
知道为什么这不起作用吗?此列表项甚至没有出现在列表中.
你在课前错过了这个点.另外,你想用"10"和"15"瞄准什么?如果您正在尝试设置宽度和高度,请在类中声明,就像您所做的那样.
它应该是:
.li_img {
width:28px;
height:32px;
background:url(https://ssl.gstatic.com/gb/images/v1_90902864.png);
}
Run Code Online (Sandbox Code Playgroud)