現場のプロが使うコーディング爆速テクニック

ウェブ初心者向け

現場のプロが使っているCSSのコーディングが爆速するコードをご紹介します。

スタイルシートの本を読んだだけでは、身に付かないことを書いています。

コーディングの速度アップしたい人は必見です。

コーディングが遅い理由を考える

スタイルシートは各要素ごとに、CSSを記載していく方法が一般的です。
しかし通常のやり方では、現場のスピード感には対応できないこともあります。

そこであらかじめ、マージンやパディングの距離を指定したCSSのクラスを登録しておくことで、コーディングが速くできます。

下記のコードを使うことでコーディングが速くなりますよ。

@charset “UTF-8”

/* font-style */

.bold { font-weight: bold !important; }
.italic { font-style : italic; }
.Ge { font-family: Georgia, “MS ゴシック”, serif; }
.Mincho { font-family: “HiraMinProN-W3”, “ヒラギノ明朝 Pro W3”, “メイリオ”, “Meiryo”, serif; }

/* font-size */
.tx10 { font-size: 77% !important; } /* renders 10px */
.tx11 { font-size: 85% !important; } /* renders 11px */
.tx12 { font-size: 93% !important; } /* renders 12px */
.tx13 { font-size: 100% !important; } /* renders 13px */
.tx14 { font-size: 108% !important; } /* renders 14px */
.tx15 { font-size: 116% !important; } /* renders 15px */
.tx16 { font-size: 123.1% !important; } /* renders 16px */
.tx17 { font-size: 131% !important; } /* renders 17px */
.tx18 { font-size: 138.5% !important; } /* renders 18px */
.tx19 { font-size: 146.5% !important; } /* renders 19px */
.tx20 { font-size: 153.9% !important; } /* renders 20px */
.tx21 { font-size: 161.6% !important; } /* renders 21px */
.tx22 { font-size: 167% !important; } /* renders 22px */
.tx23 { font-size: 174% !important; } /* renders 23px */
.tx24 { font-size: 182% !important; } /* renders 24px */
.tx25 { font-size: 189% !important; } /* renders 25px */
.tx26 { font-size: 197% !important; } /* renders 26px */

/* text-align */
.tx_L { text-align: left !important; }
.tx_C { text-align: center !important; }
.tx_R { text-align: right !important; }
.tx_j { text-align: justify !important; text-justify: inter-ideograph !important; }

/* float */
.fl_L { float: left !important; }
.fl_R { float: right !important; }
.fl_n { float: none !important; }

/* clear */
.clear { clear: both !important; }

/* overflow */
.hidden { overflow: hidden !important; }
.scroll { overflow: scroll !important; }

/* line-height */
.lh0 { line-height: 0 !important; }
.lh10 { line-height: 1.0 !important; }
.lh11 { line-height: 1.1 !important; }
.lh12 { line-height: 1.2 !important; }
.lh13 { line-height: 1.3 !important; }
.lh14 { line-height: 1.4 !important; }
.lh15 { line-height: 1.5 !important; }
.lh16 { line-height: 1.6 !important; }
.lh17 { line-height: 1.7 !important; }
.lh175 { line-height: 1.75 !important; }
.lh18 { line-height: 1.8 !important; }
.lh19 { line-height: 1.9 !important; }
.lh20 { line-height: 2.0 !important; }
.lh22 { line-height: 2.2 !important; }

/* clearfix */
.cFix:after { content: “.”; display: block; clear: both; height: 0; visibility: hidden; }
.cFix { min-height: 1px; }
* html .cFix { height: 1px; /*\*//*/ height: auto; overflow: hidden; /**/ }

/* margin */

.m0 { margin: 0 !important; }
.m0A { margin: 0 auto !important; }

.mt0 { margin-top: 0px !important; }
.mt1 { margin-top: 1px !important; }
.mt3 { margin-top: 3px !important; }
.mt5 { margin-top: 5px !important; }
.mt8 { margin-top: 8px !important; }
.mt10 { margin-top: 10px !important; }
.mt15 { margin-top: 15px !important; }
.mt20 { margin-top: 20px !important; }
.mt25 { margin-top: 25px !important; }
.mt30 { margin-top: 30px !important; }
.mt35 { margin-top: 35px !important; }
.mt40 { margin-top: 40px !important; }
.mt45 { margin-top: 45px !important; }
.mt50 { margin-top: 50px !important; }
.mt55 { margin-top: 55px !important; }
.mt60 { margin-top: 60px !important; }
.mt65 { margin-top: 65px !important; }
.mt70 { margin-top: 70px !important; }
.mt75 { margin-top: 75px !important; }
.mt80 { margin-top: 80px !important; }
.mt85 { margin-top: 85px !important; }
.mt90 { margin-top: 90px !important; }
.mt95 { margin-top: 95px !important; }
.mt100 { margin-top: 100px !important; }

.mrA { margin-right: auto !important; }
.mr0 { margin-right: 0px !important; }
.mr1 { margin-right: 1px !important; }
.mr3 { margin-right: 3px !important; }
.mr5 { margin-right: 5px !important; }
.mr8 { margin-right: 8px !important; }
.mr10 { margin-right: 10px !important; }
.mr15 { margin-right: 15px !important; }
.mr20 { margin-right: 20px !important; }
.mr25 { margin-right: 25px !important; }
.mr30 { margin-right: 30px !important; }
.mr35 { margin-right: 35px !important; }
.mr40 { margin-right: 40px !important; }
.mr45 { margin-right: 45px !important; }
.mr50 { margin-right: 50px !important; }
.mr55 { margin-right: 55px !important; }
.mr60 { margin-right: 60px !important; }
.mr65 { margin-right: 65px !important; }
.mr70 { margin-right: 70px !important; }
.mr75 { margin-right: 75px !important; }
.mr80 { margin-right: 80px !important; }
.mr85 { margin-right: 85px !important; }
.mr90 { margin-right: 90px !important; }
.mr95 { margin-right: 95px !important; }
.mr100 { margin-right: 100px !important; }

.mb0 { margin-bottom: 0px !important; }
.mb5 { margin-bottom: 5px !important; }
.mb8 { margin-bottom: 8px !important; }
.mb10 { margin-bottom: 10px !important; }
.mb15 { margin-bottom: 15px !important; }
.mb20 { margin-bottom: 20px !important; }
.mb25 { margin-bottom: 25px !important; }
.mb30 { margin-bottom: 30px !important; }
.mb35 { margin-bottom: 35px !important; }
.mb40 { margin-bottom: 40px !important; }
.mb45 { margin-bottom: 45px !important; }
.mb50 { margin-bottom: 50px !important; }
.mb55 { margin-bottom: 55px !important; }
.mb60 { margin-bottom: 60px !important; }
.mb65 { margin-bottom: 65px !important; }
.mb70 { margin-bottom: 70px !important; }
.mb75 { margin-bottom: 75px !important; }
.mb80 { margin-bottom: 80px !important; }
.mb85 { margin-bottom: 85px !important; }
.mb90 { margin-bottom: 90px !important; }
.mb95 { margin-bottom: 95px !important; }
.mb100 { margin-bottom: 100px !important; }

.mlA { margin-left: auto !important; }
.ml0 { margin-left: 0px !important; }
.ml5 { margin-left: 5px !important; }
.ml8 { margin-left: 8px !important; }
.ml10 { margin-left: 10px !important; }
.ml15 { margin-left: 15px !important; }
.ml20 { margin-left: 20px !important; }
.ml25 { margin-left: 25px !important; }
.ml30 { margin-left: 30px !important; }
.ml35 { margin-left: 35px !important; }
.ml40 { margin-left: 40px !important; }
.ml45 { margin-left: 45px !important; }
.ml50 { margin-left: 50px !important; }
.ml55 { margin-left: 55px !important; }
.ml60 { margin-left: 60px !important; }
.ml65 { margin-left: 65px !important; }
.ml70 { margin-left: 70px !important; }
.ml75 { margin-left: 75px !important; }
.ml80 { margin-left: 80px !important; }
.ml85 { margin-left: 85px !important; }
.ml90 { margin-left: 90px !important; }
.ml95 { margin-left: 95px !important; }
.ml100 { margin-left: 100px !important; }

/* padding */

.p0 { padding: 0 !important; }

.pt0 { padding-top: 0px !important; }
.pt5 { padding-top: 5px !important; }
.pt8 { padding-top: 8px !important; }
.pt10 { padding-top: 10px !important; }
.pt15 { padding-top: 15px !important; }
.pt20 { padding-top: 20px !important; }
.pt25 { padding-top: 25px !important; }
.pt30 { padding-top: 30px !important; }
.pt35 { padding-top: 35px !important; }
.pt40 { padding-top: 40px !important; }
.pt45 { padding-top: 45px !important; }
.pt50 { padding-top: 50px !important; }
.pt55 { padding-top: 55px !important; }
.pt60 { padding-top: 60px !important; }
.pt65 { padding-top: 65px !important; }
.pt70 { padding-top: 70px !important; }
.pt75 { padding-top: 75px !important; }
.pt80 { padding-top: 80px !important; }
.pt85 { padding-top: 85px !important; }
.pt90 { padding-top: 90px !important; }
.pt95 { padding-top: 95px !important; }
.pt100 { padding-top: 100px !important; }

.pr0 { padding-right: 0px !important; }
.pr5 { padding-right: 5px !important; }
.pr8 { padding-right: 8px !important; }
.pr10 { padding-right: 10px !important; }
.pr15 { padding-right: 15px !important; }
.pr20 { padding-right: 20px !important; }
.pr25 { padding-right: 25px !important; }
.pr30 { padding-right: 30px !important; }
.pr35 { padding-right: 35px !important; }
.pr40 { padding-right: 40px !important; }
.pr45 { padding-right: 45px !important; }
.pr50 { padding-right: 50px !important; }
.pr55 { padding-right: 55px !important; }
.pr60 { padding-right: 60px !important; }
.pr65 { padding-right: 65px !important; }
.pr70 { padding-right: 70px !important; }
.pr75 { padding-right: 75px !important; }
.pr80 { padding-right: 80px !important; }
.pr85 { padding-right: 85px !important; }
.pr90 { padding-right: 90px !important; }
.pr95 { padding-right: 95px !important; }
.pr100 { padding-right: 100px !important; }

.pb0 { padding-bottom: 0px !important; }
.pb5 { padding-bottom: 5px !important; }
.pb8 { padding-bottom: 8px !important; }
.pb10 { padding-bottom: 10px !important; }
.pb15 { padding-bottom: 15px !important; }
.pb20 { padding-bottom: 20px !important; }
.pb25 { padding-bottom: 25px !important; }
.pb30 { padding-bottom: 30px !important; }
.pb35 { padding-bottom: 35px !important; }
.pb40 { padding-bottom: 40px !important; }
.pb45 { padding-bottom: 45px !important; }
.pb50 { padding-bottom: 50px !important; }
.pb55 { padding-bottom: 55px !important; }
.pb60 { padding-bottom: 60px !important; }
.pb65 { padding-bottom: 65px !important; }
.pb70 { padding-bottom: 70px !important; }
.pb75 { padding-bottom: 75px !important; }
.pb80 { padding-bottom: 80px !important; }
.pb85 { padding-bottom: 85px !important; }
.pb90 { padding-bottom: 90px !important; }
.pb95 { padding-bottom: 95px !important; }
.pb100 { padding-bottom: 100px !important; }

.pl0 { padding-left: 0px !important; }
.pl5 { padding-left: 5px !important; }
.pl8 { padding-left: 8px !important; }
.pl10 { padding-left: 10px !important; }
.pl15 { padding-left: 15px !important; }
.pl20 { padding-left: 20px !important; }
.pl25 { padding-left: 25px !important; }
.pl30 { padding-left: 30px !important; }
.pl35 { padding-left: 35px !important; }
.pl40 { padding-left: 40px !important; }
.pl45 { padding-left: 45px !important; }
.pl50 { padding-left: 50px !important; }
.pl55 { padding-left: 55px !important; }
.pl60 { padding-left: 60px !important; }
.pl65 { padding-left: 65px !important; }
.pl70 { padding-left: 70px !important; }
.pl75 { padding-left: 75px !important; }
.pl80 { padding-left: 80px !important; }
.pl85 { padding-left: 85px !important; }
.pl90 { padding-left: 90px !important; }
.pl95 { padding-left: 95px !important; }
.pl100 { padding-left: 100px !important; }

コメント