reset.css
2018-07-10 本文已影响8人
冰镇苏打水
reset.css
在写CSS
过程中.习惯了领导教会的把一切样式预备好, 随时补充
/*初始化样式*/
body,ol,ul,h1,h2,h3,h4,h5,h6,p,th,td,dl,dd,form,fieldset,legend,input,textarea,select{margin:0;padding:0}
body{font:12px"宋体","Arial Narrow",HELVETICA;background:#fff;-webkit-text-size-adjust:100%;}
a{color:#3399FF;text-decoration:none}
a:hover{color:#2b90d9;text-decoration:underline}
em{font-style:normal}
li{list-style:none}
img{border:0;vertical-align:middle}
table{border-collapse:collapse;border-spacing:0}
p{word-wrap:break-word}
/*常用类名*/
.m-a-0{margin: 0;}
.p-a-0{padding: 0;}
.m-t-0{margin-top:0px;}
.m-b-0{margin-bottom:0px;}
.m-l-0{margin-left:0px;}
.m-r-0{margin-right:0px;}
.p-t-0{padding-top:0px;}
.p-b-0{padding-bottom:0px;}
.p-l-0{padding-left:0px;}
.p-r-0{padding-right:0px;}
.m-t-5{margin-top:5px;}
.m-b-5{margin-bottom:5px;}
.m-l-5{margin-left:5px;}
.m-r-5{margin-right:5px;}
.p-t-5{padding-top:5px;}
.p-b-5{padding-bottom:5px;}
.p-l-5{padding-left:5px;}
.p-r-5{padding-right:5px;}
.m-t-10{margin-top:10px;}
.m-b-10{margin-bottom:10px;}
.m-l-10{margin-left:10px;}
.m-r-10{margin-right:10px;}
.p-t-10{padding-top:10px;}
.p-b-10{padding-bottom:10px;}
.p-l-10{padding-left:10px;}
.p-r-10{padding-right:10px;}
.m-t-15{margin-top:15px;}
.m-b-15{margin-bottom:15px;}
.m-l-15{margin-left:15px;}
.m-r-15{margin-right:15px;}
.p-t-15{padding-top:15px;}
.p-b-15{padding-bottom:15px;}
.p-l-15{padding-left:15px;}
.p-r-15{padding-right:15px;}
.m-t-20{margin-top:20px;}
.m-b-20{margin-bottom:20px;}
.m-l-20{margin-left:20px;}
.m-r-20{margin-right:20px;}
.p-t-20{padding-top:20px;}
.p-b-20{padding-bottom:20px;}
.p-l-20{padding-left:20px;}
.p-r-20{padding-right:20px;}
.m-t-25{margin-top:25px;}
.m-b-25{margin-bottom:25px;}
.m-l-25{margin-left:25px;}
.m-r-25{margin-right:25px;}
.p-t-25{padding-top:25px;}
.p-b-25{padding-bottom:25px;}
.p-l-25{padding-left:25px;}
.p-r-25{padding-right:25px;}
.m-t-30{margin-top:30px;}
.m-b-30{margin-bottom:30px;}
.m-l-30{margin-left:30px;}
.m-r-30{margin-right:30px;}
.p-t-30{padding-top:30px;}
.p-b-30{padding-bottom:30px;}
.p-l-30{padding-left:30px;}
.p-r-30{padding-right:30px;}
.m-t-35{margin-top:35px;}
.m-b-35{margin-bottom:35px;}
.m-l-35{margin-left:35px;}
.m-r-35{margin-right:35px;}
.p-t-35{padding-top:35px;}
.p-b-35{padding-bottom:35px;}
.p-l-35{padding-left:35px;}
.p-r-35{padding-right:35px;}
.m-t-40{margin-top:40px;}
.m-b-40{margin-bottom:40px;}
.m-l-40{margin-left:40px;}
.m-r-40{margin-right:40px;}
.p-t-40{padding-top:40px;}
.p-b-40{padding-bottom:40px;}
.p-l-40{padding-left:40px;}
.p-r-40{padding-right:40px;}
.m-t-45{margin-top:45px;}
.m-b-45{margin-bottom:45px;}
.m-l-45{margin-left:45px;}
.m-r-45{margin-right:45px;}
.p-t-45{padding-top:45px;}
.p-b-45{padding-bottom:45px;}
.p-l-45{padding-left:45px;}
.p-r-45{padding-right:45px;}
.m-t-50{margin-top:50px;}
.m-b-50{margin-bottom:50px;}
.m-l-50{margin-left:50px;}
.m-r-50{margin-right:50px;}
.p-t-50{padding-top:50px;}
.p-b-50{padding-bottom:50px;}
.p-l-50{padding-left:50px;}
.p-r-50{padding-right:50px;}
.m-t-55{margin-top:55px;}
.m-b-55{margin-bottom:55px;}
.m-l-55{margin-left:55px;}
.m-r-55{margin-right:55px;}
.p-t-55{padding-top:55px;}
.p-b-55{padding-bottom:55px;}
.p-l-55{padding-left:55px;}
.p-r-55{padding-right:55px;}
.m-t-60{margin-top:60px;}
.m-b-60{margin-bottom:60px;}
.m-l-60{margin-left:60px;}
.m-r-60{margin-right:60px;}
.p-t-60{padding-top:60px;}
.p-b-60{padding-bottom:60px;}
.p-l-60{padding-left:60px;}
.p-r-60{padding-right:60px;}
.m-t-65{margin-top:65px;}
.m-b-65{margin-bottom:65px;}
.m-l-65{margin-left:65px;}
.m-r-65{margin-right:65px;}
.p-t-65{padding-top:65px;}
.p-b-65{padding-bottom:65px;}
.p-l-65{padding-left:65px;}
.p-r-65{padding-right:65px;}
.m-t-70{margin-top:70px;}
.m-b-70{margin-bottom:70px;}
.m-l-70{margin-left:70px;}
.m-r-70{margin-right:70px;}
.p-t-70{padding-top:70px;}
.p-b-70{padding-bottom:70px;}
.p-l-70{padding-left:70px;}
.p-r-70{padding-right:70px;}
.m-t-75{margin-top:75px;}
.m-b-75{margin-bottom:75px;}
.m-l-75{margin-left:75px;}
.m-r-75{margin-right:75px;}
.p-t-75{padding-top:75px;}
.p-b-75{padding-bottom:75px;}
.p-l-75{padding-left:75px;}
.p-r-75{padding-right:75px;}
.m-t-80{margin-top:80px;}
.m-b-80{margin-bottom:80px;}
.m-l-80{margin-left:80px;}
.m-r-80{margin-right:80px;}
.p-t-80{padding-top:80px;}
.p-b-80{padding-bottom:80px;}
.p-l-80{padding-left:80px;}
.p-r-80{padding-right:80px;}
.m-t-85{margin-top:85px;}
.m-b-85{margin-bottom:85px;}
.m-l-85{margin-left:85px;}
.m-r-85{margin-right:85px;}
.p-t-85{padding-top:85px;}
.p-b-85{padding-bottom:85px;}
.p-l-85{padding-left:85px;}
.p-r-85{padding-right:85px;}
.m-t-90{margin-top:90px;}
.m-b-90{margin-bottom:90px;}
.m-l-90{margin-left:90px;}
.m-r-90{margin-right:90px;}
.p-t-90{padding-top:90px;}
.p-b-90{padding-bottom:90px;}
.p-l-90{padding-left:90px;}
.p-r-90{padding-right:90px;}
.m-t-95{margin-top:95px;}
.m-b-95{margin-bottom:95px;}
.m-l-95{margin-left:95px;}
.m-r-95{margin-right:95px;}
.p-t-95{padding-top:95px;}
.p-b-95{padding-bottom:95px;}
.p-l-95{padding-left:95px;}
.p-r-95{padding-right:95px;}
.m-t-100{margin-top:100px;}
.m-b-100{margin-bottom:100px;}
.m-l-100{margin-left:100px;}
.m-r-100{margin-right:100px;}
.p-t-100{padding-top:100px;}
.p-b-100{padding-bottom:100px;}
.p-l-100{padding-left:100px;}
.p-r-100{padding-right:100px;}
.font-1{font-size: 9px;}
.font-2{font-size: 12px;}
.font-3{font-size: 14px;}
.font-4{font-size: 16px;}
.font-5{font-size: 18px;}
.font-6{font-size: 20px;}
.font-7{font-size: 25px;}
.font-8{font-size: 30px;}
.font-9{font-size: 40px;}
.font-10{font-size: 50px;}
.font-11{font-size: 60px;}
.font-12{font-size: 70px;}
.font-w-bold{font-weight: bold;}
.font-w-500{font-weight: 500;}
.font-w-600{font-weight: 600;}
.pull-left{float: left;}
.pull-right{float: right;}
.clearfix{overflow: hidden;}
.t-a-l{text-align: left;}
.t-a-c{text-align: center;}
.t-a-r{text-align: right;}
.hide{display: none;}
.cursor-pointer {cursor: pointer;}
.table-vam td, .table-vam th {vertical-align: middle;}
生成 margin padding
<?php
$PHP_EOL = PHP_EOL;
if($argv[1] === 'min') {
$PHP_EOL = '';
}
$fp = fopen("test.css",'x+');
function setBox()
{
$style = [
'm'=> 'margin',
'p'=> 'padding'
];
$place = [
't' => 'top',
'b' => 'bottom',
'l' => 'left',
'r' => 'right'
];
for ($i=0; $i <= 100; $i+=5) {
foreach ($style as $key => $value) {
foreach ($place as $k => $v) {
file_put_contents("test.css", ".{$key}-{$k}-{$i}{"."{$value}-{$v}:{$i}px".";}{$PHP_EOL}", FILE_APPEND);
}
}
}
}
setBox();
fclose($fp);
?>