CSS3用户界面

2019-01-11  本文已影响0人  陈裔松的技术博客

appearance属性

.none > input {
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
}
// 只有checkbox的样式而已,不能像原装checkbox一样选中
// 这里只能输入,因为原来就是个输入框
.checkbox > input {
    -webkit-appearance: checkbox;
       -moz-appearance: checkbox;
            appearance: checkbox;
}

text-overflow属性

// 注意overflow: hidden,溢出隐藏
// 注意white-space: nowrap;意思是强制不换行
ul > li > p { white-space: nowrap; width: 200px; overflow: hidden; }
ul > li.clip > p {
    text-overflow: clip;
}
ul > li.ellipsis > p {
    text-overflow: ellipsis;
}

outline属性

div { width: 100px; margin: 100px; padding: 10px; border: 3px solid #333;
    outline: 5px solid #f00;
}

// outline-offset属性:设置或检索对象外的线条轮廓偏移容器的值,允许负值
div { width: 100px; margin: 100px; padding: 10px; border: 3px solid #333;
    outline: 1px solid #0f0;
    outline-offset: 10px;
}

cursor属性

.test { width: 400px; border-collapse: collapse; font: 14px/1.5 georgia, arial, serif, sans-serif; }
.test td { padding: 2px 10px; border: 1px solid #ddd; }
.test td:hover { background: #eee; }
.auto { cursor: auto; }
.default { cursor: default; }
.none { cursor: none; }
.context-menu { cursor: context-menu; }
.help { cursor: help; }
.pointer { cursor: pointer; }
.progress { cursor: progress; }
.wait { cursor: wait; }
.cell { cursor: cell; }
.crosshair { cursor: crosshair; }
.text { cursor: text; }
.vertical-text { cursor: vertical-text; }
.alias { cursor: alias; }
.copy { cursor: copy; }
.move { cursor: move; }
.no-drop { cursor: no-drop; }
.not-allowed { cursor: not-allowed; }
.e-resize { cursor: e-resize; }
.n-resize { cursor: n-resize; }
.ne-resize { cursor: ne-resize; }
.nw-resize { cursor: nw-resize; }
.s-resize { cursor: s-resize; }
.se-resize { cursor: se-resize; }
.sw-resize { cursor: sw-resize; }
.w-resize { cursor: w-resize; }
.ew-resize { cursor: ew-resize; }
.ns-resize { cursor: ns-resize; }
.nesw-resize { cursor: nesw-resize; }
.nwse-resize { cursor: nwse-resize; }
.col-resize { cursor: col-resize; }
.row-resize { cursor: row-resize; }
.all-scroll { cursor: all-scroll; }
.zoom-in { cursor: zoom-in; }
.zoom-out { cursor: zoom-out; }
.url { cursor: url(skin/cursor.gif), url(skin/cursor.png), url(skin/cursor.jpg), pointer; }

zoom属性

// 可用于放大镜效果
.test  { zoom: normal; }
.test2 { zoom: 5;      }
.test3 { zoom: 300%;   }

box-sizing属性

.test {
    -webkit-box-sizing: content-box;
       -moz-box-sizing: content-box;
            box-sizing: content-box;
}
.test2 {
    -webkit-box-sizing: border-box;
       -moz-box-sizing: border-box;
            box-sizing: border-box;
}

resize属性

// resize只能把它拉大,不能拉小
.none { resize: none; }
.both { resize: both; }
.horizontal { resize: horizontal; }
.vertical { resize: vertical; }

user-select属性

.none { user-select: none; }
上一篇 下一篇

猜你喜欢

热点阅读