CSS Master
body{margin:20px 30px;padding:100px;margin-left:0}h1{font:200 36px/ ➥1.5 sans-serif}h1{color:#f60} NowourCSSisminified,butnotopt ...
CSS Lint CSSLintisthegrandmotherofthesecode-qualitytools.CreatedbyNicoleSullivan andNicholasZakas,it’savailablebothasanNPMpackag ...
Figure 3.26. Terminal output from CSS Lint CSSLintinspectsyourstylesheetsforfourkindsofCSSproblems: Compatibility: problemsthata ...
■ selectorordeclarationatfault CSSLintprintsoutputtotheterminalwindow.Ifyou’drathersaveitasafile,use theredirectionoperator.This ...
Installation You’reprobablysensingapatternhere.Installanalyze-cssusingNPMwiththe followingcommand: npm install -g analyze-css Ba ...
"oldPropertyPrefixes": [ "[id=landing] .logo { -moz-transition: transform 150ms ease-in ➥ 10ms, opacity 150ms ease-in } // was r ...
npm install -g uncss Using UnCSS from the Command Line UnCSSrequiresthefilepathorURLofanHTMLpagethatcontainsalinkedCSS file;fore ...
andJavaScript,youcaneasilyreusethemacrossprojectsorsharethemwithateam. CSSLint,UnCSS,andCSSOareallavailableasbothGruntandGulpplu ...
...
Chapter 4 Complex Layouts 4. Complex Layouts Inthischapter,we’lldigintoafewCSSlayouttopics.Inthefirsthalf,we’lltackle twofundame ...
betweenblock-levelandinlineelements.Bydefault,elementssuchaspandsection createblock-levelboxesbuta,span,andemcreateinlineboxes.S ...
Figure 4.2. An example of an inline box with margin: 1em and padding: 5px applied Buthowarethedimensionsoftheboxcalculated?Herei ...
300 pixelswidewith 20 pixelsofpaddinganda 10 pixelborder,thewidthneeds tobe240px.Mostleadingbrowserscalculatedthewidthinjustthis ...
Settingthevalueofbox-sizingtoborder-boxcreatesalittlebitofmagic.Now, thevaluesofwidthandheightwillbeappliedtotheouterborderedgei ...
aside { width: 40%; } Figure 4.5. Elements with box-sizing: content-box Bydefault,bothasideandarticlehaveabox-sizingvalueofconte ...
Figure 4.6. Elements with box-sizing: border-box. I'dsuggestthatyouusebox-sizing: border-boxinyourprojects.Itmakeslife easier,as ...
*, *:before, *:after { box-sizing: inherit; } Thisappliesborder-boxsizingtoeveryelementbydefault,withoutaffectingthe box-sizingb ...
applied.Whetherpartofarootorlocalcontext,childrenwithinastackingcontext arepaintedtothescreenfromback-to-frontasfollows: 1.Child ...
#a { background: rgba(233, 30, 99, 0.5); } #b, #c, #d, #e { position: absolute; } #b { background: rgba(103, 58, 183, 0.8); bott ...
Figure 4.7. A stacking context with positioned and unpositioned elements of varying z-index values Alltheelementsinthepreviousex ...
«
3
4
5
6
7
8
9
10
11
12
»
Free download pdf