只是玩: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;
}
Run Code Online (Sandbox Code Playgroud)
相同的代码工作正常 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;
}
Run Code Online (Sandbox Code Playgroud) 我在一个页面上有2个列的几个div,所以每2个div需要相同的高度.据我所知,插件可用于强制相等的高度,所有元素都是相同的高度,我只需要每对都是相同的高度.
我的标记看起来像这样
等等
我有以下jquery工作,但我相信它可以更容易完成
{
var rowOneHeight = Math.max($('div.large:eq(0)').height(),$('div.large:eq(1)').height());
$('div.large:eq(0)').css('min-height', rowOneHeight);
$('div.large:eq(1)').css('min-height', rowOneHeight);
var rowTwoHeight = Math.max($('div.large:eq(2)').height(),$('div.large:eq(3)').height());
$('div.large:eq(2)').css('min-height', rowTwoHeight);
$('div.large:eq(3)').css('min-height', rowTwoHeight);
var rowThreeHeight = Math.max($('div.large:eq(4)').height(),$('div.large:eq(5)').height());
$('div.large:eq(4)').css('min-height', rowThreeHeight);
$('div.large:eq(5)').css('min-height', rowThreeHeight);
Run Code Online (Sandbox Code Playgroud)
}
它也需要与一组三个div完成相同的操作.谢谢