<input type="text" value="3" class="field left" readonly>
.content {
width: 100%;
box-sizing: border-box;
}
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #ccc;
margin: 1em 0;
padding: 0;
}
#demo
{
background:url(bg_apple_little.gif) no-repeat center center;
height:200px;
width:200px;
}
function css(a) {
var sheets = document.styleSheets, o = {};
for (var i in sheets) {
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (a.is(rules[r].selectorText)) {
o = $.extend(o, css2json(rules[r].style), css2json(a.attr('style')));
}
}
tr:nth-child(even) { background-color: #000000; }
以上方法不适用于IE8及以下版本。
也可用通过jQuery的方法实现:
$(document).ready(function() {
$("tr:even").css("background-color", "#000000");
});
简单的tooltip:
<div title="This is my tooltip">
复杂的tooltip参考:http://www.designer-daily.com/jquery-prototype-mootool-tooltips-12632
function css(a) {
var sheets = document.styleSheets, o = {};
for (var i in sheets) {
var rules = sheets[i].rules || sheets[i].cssRules;
for (var r in rules) {
if (a.is(rules[r].selectorText)) {
o = $.extend(o, css2json(rules[r].style), css2json(a.attr('style')));
}
}
div {
width: 100%;
width: -webkit-calc(100% - 50px);
width: -moz-calc(100% - 50px);
width: calc(100% - 50px);
}
热门内容
最新内容
- 2 days 5 hours ago
- 4 days 7 hours ago
- 1 week ago
- 1 week 3 days ago
- 2 weeks 4 days ago
- 3 weeks ago
- 3 weeks ago
- 3 weeks ago
- 3 weeks ago
- 3 weeks 1 day ago
最新评论