当前第2页 返回上一页
border-box:(textarea和select默认值)在规定的一个框的宽高之内给这个框加内边距和边框。
1 2 3 4 | box-sizing: content-box;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
|
二、美化input框
1 2 3 4 5 6 7 8 | input[type=text]::-ms-clear,::-ms-reveal{display:none;}
input::-ms-clear,::-ms-reveal{display:none;}
input{
outline: none;
}
|
三、美化textarea文本域
1 2 3 4 5 6 7 8 | textarea{
outline: none;
resize: none;
}
|
四、改变placeholder的字体颜色大小
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | input::-webkit-input-placeholder {
font-size:14px;
color: #333;
}
input:-moz-placeholder {
font-size:14px;
color: #333;
}
input::-moz-placeholder {
font-size:14px;
color: #333;
}
input:-ms-input-placeholder {
font-size:14px;
color: #333;
}
|
五、美化select
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | select::-ms-expand { display: none; }
select {
border: solid 1px #333;
appearance:none;
-moz-appearance:none;
-webkit-appearance:none;
background: url("小箭头图片路径") no-repeat right center transparent;
padding-right: 14px;
outline: none;
}
|
六、美化button按钮
1 2 3 4 5 6 7 | button{
border: none;
background: #333;
}
|
七、美化单选框、多选框或者是上传文件按钮
1 2 3 | <label for="sex">男</label>
<input type="radio" id="sex" value="男" />
|
八、多出文字用省略号表示
1 2 3 | white-space: nowrap;
overflow:hidden; / *内容超出宽度时隐藏超出部分的内容 */
text-overflow:ellipsis;
|
九、css页面点击文字出现蓝色底色去掉方法
1 2 3 4 5 | -moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
-khtml-user-select: none;
user-select: none;
|
十、在遇见图标的垂直位置很难调整的时候可以用这个属性
1 2 | vertical-align: 30%;
vertical-align: middle;
|
十一、如何让一个p在页面中上下左右居中
1 2 3 4 5 6 7 8 | p{
width:400px;
height:300px;
position:absolute;
top:50%;
left:50%;
margin:-150px 0 0 -200px;
}
|
十二、js
1 2 3 4 5 | onclick = 'history.go(-1)';
window.location.reload(true);
|
十三、换行,不换行,字间距

以上就是网页制作时的高实用性小技巧总结的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
html段落的知识总结
dreamweaver网页制作使用css样式嵌套方法
网页制作时的高实用性小技巧总结
h5设计时的小技巧总结
jquery $()用法总结
html文本格式的知识总结
最全的css样式整理总结
html5新增标签总结
html中频繁用的标签总结
html中关于盒模型的总结
更多相关阅读请进入《网页制作》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » 网页制作时的高实用性小技巧总结