【发布时间】:2011-05-21 04:05:35
【问题描述】:
只是在玩:before 和:after。
似乎我不能在input 按钮上使用它们?认为我可能会使用它确实会为必填字段显示一个星号。不一定我会做什么,只是一种选择
input {
position: relative;
}
input:after {
content: '';
background: url(accept.png) 0 0 no-repeat;
height: 16px;
position: absolute;
right: -20px;
top: 5px;
width: 16px;
}
同样的代码在li 上也能正常工作
li {
clear: both;
margin: 0 0 10px;
position: relative;
}
li:after {
content: '';
background: url(accept.png) 0 0 no-repeat;
height: 16px;
position: absolute;
right: -20px;
top: 5px;
width: 16px;
}
【问题讨论】:
标签: css css-selectors