I liketohelppeoplefallinlovewithCSSandoneofthewaystodothatistotakeoffourtrainingwheels
我喜歡幫助人們愛上 CSS,而實現這一目標的方法之一就是摘掉我們的 "訓練輪"。
Andsotodaywe'regonnabelookingatsome
是以,今天我們將探討一些
Tricksthatwecandotohelpwhenitcomestowritinglesscodebecausewhenyoujustuse a singleclassforeverythingsometimesyouendupwith a lotmorecodethanyouactuallyneedandalsolookatsomecoollittleuserinteractiontricksthatwe
CandowithsomemoreadvancedCSSselectorsandwe'regoingtodothatbydivingintothisexamplethat I haveherewherewe'regonnaexplore a wholebunchofdifferentthingsand
So I couldtakethisandthenalsodoitforthe 8thandalsodoitforthe 9th
是以,我可以把這個也用於第 8 次會議,還可以用於第 9 次會議。
Butthere's anotherwayandwecanusethistoselectrangesofcontentaswellandsothefirstthingwewanttodoisactuallysayit's gonnabean n plus 7 andwhatthatmeansisit's
但還有另一種方法,我們也可以用它來選擇內容範圍,所以我們要做的第一件事就是說它將是 n 加 7,這意味著它是
Sotobeabletodothatwhen I sayinteracting I'm gonnadoitas a hover
是以,當我說交互時,我將把它作為懸停來做。
Butthiscouldworkwith a focusaswell
但這也可以與重點相結合
Myimagescan't befocusedand I wouldn't reallywantthemtobebutifyoudidthisin a differentwaywhereyoumighthavelinksorotherthingsthatareinvolvedyoucoulddefinitelydowiththiswithfocusstatestoandwe'regonnasaythatwehavemy
Thoselookreallyweirdfor a longtimeuntilweallgotusedtothemthisisactuallysomething I wentkindofin-depthinandlookedat a bunchofdifferentpatternsthatwehavenewmodernwaysof
在很長一段時間裡,這些圖案看起來非常奇怪,直到我們都習慣了它們。
Doingthataremuchbetterthantheoldways
比老辦法好得多的做法
Buttheoldwaysare
但老辦法
Familiarpatternsthatpeopleareusedtoand I justmadetheargumentthatweshouldprobablybelookingatmovingontothenewer