//html代码 <div class="operateWays"> <label> <input type="radio" name="Sex"> <span>男</span> </label> <label> <input type="radio" name="Sex" checked="checked"> <span>女</span> </label> </div> //css代码 .operateWays label{ line-height: 3rem; height: 3rem; margin-right: 5px; position: relative; } .operateWays label input[type='radio'],.operateWays label span{ width: 50px; height:3rem; margin-top:5px; } .operateWays label span{ position: absolute; top: 0px; left: 0px; display: block; text-align: center; border: 1px solid #ddd; background: #fff; color: #666; border-radius: 2px; } .operateWays label input[type='radio']{ opacity: 0; filter: alpha(opacity=0); } .operateWays label input[type='radio']:checked+span{ background: #4A943D; border-color: #4A943D; color: #fff; } .operateWays label span:hover{ cursor:pointer; }
1).单选按钮最终显示的效果:css
//css代码 .fileinputBtn { height: 35px; position: relative; width: 80px; overflow: hidden; } input[type="file"] { position: absolute; top: 0px; left: 0px; font-size: 100px; opacity: 0; filter: alpha(opacity=0); }
.btn-success{
background-color: #3a9d5d;
border-color: #3a9d5d;
-webkit-appearance: push-button;
white-space: nowrap;
font-size: inherit;
-webkit-user-modify: read-only;
margin: 0px;
} //html代码 <div class="fileinput-button fileinputBtn btn btn-success"> <input type="file" name="AdPicture" data-upload-type="IMAGE" accept="image/*"> 上传文件
</div>
2).上传按钮最终显示的效果是:html
3).这是一段纯css清楚浮动:web
/*清除浮动效果*/
.clearfix:after{
content:"020";//或者使用"."来代替
display:block;
height:0;
clear:both;
visibility:hidden;
}
.clearfix{
zoom:1;
}
4).bootstrap中清除浮动:bootstrap
// Mixin itself
.clearfix(){&:before,&:after{content:" ";display:table;}&:after{clear:both;}}// Usage as a mixin
.element{.clearfix();}
5).css中伪类和伪元素的区别:浏览器
基本的格式是:
@font-face {
font-family: <YourWebFontName>; src: <source> [<format>][,<source> [<format>]]*; [font-weight: <weight>]; [font-style: <style>]; }
取值的简单说明:
YourWebFontName:是指你自定义的字体名称
source:指你自定义的字体的存放路径
format:指你自定义字体的格式
weight/style:前者是定义字体的粗体,后者是定义字体样式app
/*为了让各个浏览器支持的写法*/
@font-face {
font-family: 'YourWebFontName';
src: url('YourWebFontName.eot');
src: url('YourWebFontName.eot?#iefix') format('embedded-opentype'),
url('YourWebFontName.woff') format('woff'),
url('YourWebFontName.ttf') format('truetype'),
url('YourWebFontName.svg#YourWebFontName') format('svg');
}
7).设置隐藏并使用背景图片来修饰:svg
selected::-ms-expand————下拉框(ie中删除select的方法)字体
input::-ms-check————单选、复选框url
input::-ms-clear————表单文本框 spa
1 input::-webkit-outer-spin-button, 2 input::-webkit-inner-spin-button{ 3 -webkit-appearance: none !important; 4 margin: 0; 5 }
2.在火狐上:
1 input[type="number"]{ 2 -moz-appearance:textfield; 3 }
b.在解决type='number'的问题上,若是再苹果手机解决不了的时候,能够经过使用type='tel'来作替换操做