我使用以下代码查看产品ID。为每个列表使用背景图像。我想把图像放在前面,文字又回来了。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
.addcart
{
}
.addcart ul{
list-style:none;
}
.addcart li{
list-style:none;
background-image:url(round.png);
background-repeat: no-repeat;
height:45px;
top:0px;
}
.addcart h3
{
font-size:24px;
font-weight:bold;
padding:10px 0px 40px 10px;
color:#F00;
z-index:400px;
position:relative;
}
</style>
</head>
<body>
<ul class="addcart">
<li><span><h3>96</h3></span></li>
<li><h3>97</h3></li>
</ul>
</body>
</html>
答案 0 :(得分:1)
如果您只想隐藏文字,请执行以下操作:
.addcart h3 {
position : absolute;
left : -9999px;
}
答案 1 :(得分:1)
你想要文字回来吗?我可以建议你用
隐藏它display:none;
如果这不是您工作的可行解决方案,您能否详细说明其功能?
答案 2 :(得分:0)
您可以添加.addcart li?
text-indent:-9999em;
答案 3 :(得分:0)
我想最好的方法是通过Javascipt或jQuery将文本的显示属性设置为 none 。无需发回。或者您有什么特别的理由将其寄回去吗?
答案 4 :(得分:0)
z-index不是以像素为单位的属性,它应该是
z-index: 400;
另外,使用h3这种方式不是最优的,我会用span代替;无论如何,你正在增加字体大小,所以你不需要在h3上转发它。