Andtodaywe'regoingThio, dosomethingthat I'm a littlelessexperiencedthatthentheotherthingsthattypicallydoingstream s Sowhatwedohereonthechannelisusuallyimplementsomethingfromscratch.
So I ammoreexperiencewithgamedevelopment, Sousually I makegamesfromscratch.
However, thisyear, as I'vesaidinpriorstreams, oneofmygoalsistogetbetteratWebdevelopment.
Andwehave a bunchofstaffmembersthatarealsomuchbetterskilledatWebdevelopment.
Buttoday I'm takingitonmyself.
Thio, usurperThelasttutorial I did, whichwasonhtmlsortof.
We'llbelookingatCSStoday, SoifyoutunedinfortheHTMLstream, youprobablysawthatthepageswewereimplementinglasttimewithTomTomballotorwhohappenedtobeherefromJapanfor a briefstint, theywere a littlebitontheaustereside.
Everythingissortofblackandwhite.
Wehadtext, wehadimagesandthatwasprettymuchit.
Youknow, wehad a coupleoffunlittleexercisesanddemostheretoshowcasethingslikegifts, whichareanimatedimages.
Sowehad a lotofchatinthe, uhwehad a lotofpeoplepostingmessagesinthechatpriortothestreamisbeginning.
And I alsowanttoshoutout Z h e l orgelanychuandgreatberamforfollowingbeforethestream.
Andsomefolkswerecuriousaboutwhatthemusicwas, So I'm goingtoactuallyturntomycomputerhere, andthisisthechannelthat I playedmusicfrombeforeeverystream, sotheyhave a verygenerous, noncopyrightedlicense.
Thisinparticular, is a verygoodsortofplaylistthattheyputtogether, whichispremixed, whichisreallyniceforthestreams.
It's nocopyrightsoundsisthenameofthechannel, andalloftheirmusiciscompletelyplayableforfolkssuchasuswhowants a musicbeforestreamorfor a YouTubechannelorwhatnot.
So I usethemforallofmysortofmusicneeds.
Andthisismedoingsomeresearchinadvanceofthestream.
Letmemakesurethat I didn't missanybodyelse's comments.
ObilicyoursasLeeWhipstreak, whichisNateGravy.
Wait 123 blade A.
G.
Thankyouallverymuchfortuningin, um, gravywayofsayingalso a moment.
I actuallyhavenoideahowtopronouncethatsolemnYou'lllikewhom.
I'm notsureyou'resayingthatthat's apparentlygreetingsinArabic, and I, unfortunatelyhavenoArabicknowledge.
AlthoughKarimspeaksArabic, havecreamwerehere, hecouldget a vouch.
Sokeephimwithtwomissingbanks.
Leadthattheylovethemusic.
Thunder 44 7 71 Whatwasthemusic?
Yeah, thatchannel.
NocopyrightsoundsWhippedstreetssaying, I loveCSSOnate, actually, maybeevenbetteratCSS.
And I am.
AndNateisactually 10 yearsold, whichisinsane.
SoshoutittoNateforjoiningusatsuch a youngageasthesaying.
I hateHTML, but I'm herehopingthat I likeCSS.
Well, hopefully I don't ruinthatimageforyou, Bartel D says.
Hello.
Hello, Bartel D um, withus.
Wehavehere.
Ashewassaying, someoneaskedwhen I learnedbootstrapinsteadofCSS.
Andactuallywewillprobablybedoing a bootstrapstreamwiththenext.
Actually, no.
Wewillbedoing a bootstrapstreamnextFriday, andwe'llbedoingthatwithAaron, Sotuneinforthatone.
Bootstrapis a layerontopofCSS, soit's kindof a bunchofCSSthatpeopleit's a libraryorframeworkIt's a bunchofCSSandJavascriptwhichwewon't getintotodaythat a bunchoffolkskindlyputtogetherworkingatTwitterwhentheyweredevelopingTwitter.
Andit's a greatfoundationallayer.
Thiobuild a websiteoffofwhereyoudon't needtoknowthelowleveldetailsofCSSquiteasmuch.
There's a tonofCSS a tonofattributesandwhatnotthatyoucanlearn.
Umuh, checkdressingwasverysoonbeingsure.
I'vecompletelyatthemKloppenburghereinthechat.
Hello, Martin.
Goodtoseeyou.
GreatMaramwhofollowed.
ThankyousomuchSnow.
Orissays.
Hello, PhyllisNorris.
AndtheykeepforShawn, 11 forthefollowers.
Well, aretheygonnabuild a WebappwithCSS?
Isthunder 44 7 71 Webappis, I think, a misnomer.
I'm not a webatperse, butwewillbemaking a coupleofindependingon.
Thisisdependentonhowmuchtimeweactuallyhave.
So I'veallocatedaboutthreehoursforthestream.
Sowedohave a fewideasare I haveputtogether a fewsimpleideasforsomesimpleWebpagesthatstilllookprettynice, oneeveninspiredby C s fiftieshomepagethatwe'llgettoimplementing.
Onceyouunderstand a bitofCSSfromhere, bootstrapwillbe a walkinthepark.
Likeforreal, youcouldcreate a websiteathoursanddays.
It's thebestthing I discoverediskeepingyoutoomuch.
Yeah, nobookshopisgreat.
It, uhitallowsyoutodio a tonofstuff.
I'm sorry.
Justonesecond.
Yeah.
Itallowsyoutodo a lotofstuffthatwouldnormallybekindof a hassle.
Like, forexample, creating a knavebarwhichwilltrytoimplementtoday.
DoingthatinCSSisincrediblyeasy.
Youbasicallyjustpluginandwe'lllookatwhatthisis.
Well, lookatclasseswillsayclasses.
Ourconceptthatwecanaddtoourhtmltosortofspecifythatweshouldprobablyput, youknow, maybewewantcertainelementstohave a boldlike a large, boldsizeand a particularfun.
Andmaybetheyhaveah, semanticvalue.
Maybethey're, youknow, in a nowBarcelonawillbeconsideredknaveelementsorwhatnot.
Anddependingonwhenitgetsto a certainsize, itcouldsetordisabledcertainelements, sothisallowsyoutohave, andthisis a bigthingaboutbootstrapisbootstrapallowsyoutoresizeyourpage.
Sowe'rebasicallysayingwhenthebrowsergetstobe a certainminimumwithrightormaximumwith, thenweneedthio, shrinkitdown, I guesswouldbe a minimumwithwewouldneedThioessentiallychangetheCSSsuchthattheknavetheheadergoesatthetop.
Weget a menuheresonormallycalled a hamburgermenu.
Butthere's nohamburgericon.
Wecanclickthatandopenitup, andthat's a Javascriptabilityandthenallthecontentinsteadofbeingalignedontherightsideofthepage.
FlexboxesDifferentFlexBoxissortof a dynamiccontainer.
It's hardtodescribeexactlyhowitisessentiallyallowsyoutogroupelements, blockelementstogetherandhavethemdynamicallysortoffill a spacehorizontally.
Andyoucoulddo a bunchofcoolstuffwith a verticalcenteringandsomeothercoolstuff.
I'm notsurehowindepthwecangettothat.
Wecouldmaybepullupsomearticleslater, dependingonhowfarwegetwith a thedemosontheactualyouknow, lowleveldetailsofflexbox, somethingthat I'm stillverymuchlearning.
Um, butyeah, thatisessentiallywhatFlexboxis, andwhatimmediateclearisYeah, plGreetingsfromPolandBihariWebanimationtoWewillnotbecoveringCSSanimation, soit's verywecouldveryeasilysplitthisdreamupintolikefiveseparatestreamsandthatwouldbetheCSSanimationswouldbe a greatthingtohave a parttoandmaybemediaqueriesandmayberesponsivedesignkindofas a separatestream.
Andthatwouldbe a greatwaytotieallthesetechnologiestogetherbecausethatkindofgetsintothemoredynamicfeaturesofCSS.
Andwedothatultimatelywiththingscalledclassesand I D.
S.
Althoughthat's notstrictlynecessary.
It's definitely a muchmorerobustwayofdoingit.
I canillustratethelessidealwayofdoingithereifwewritesomesimpleHTML.
So I'm gonnagoandsavemyselfthatCSSpageandwe'lllookatthatin a littlesecondhere.
Butagainfromlasttimein V S codeandothermoderntexteditors, ifyou'reifyouhaveanHTMLfileyouthatyou'vesavedwithsome, forexample, indexthathtml I cangodownthio.
I cantypethewordliterallythewordHTML.
I getthislittlemenuthatkindofdynamicallypopsup.
I canchoosethesedifferentoptionshere.
I'm gonnachoosethe 2nd 1 whichjustsayssimplehtmlfivestartingpointjustsothatitautofillsmytexteditorwith a bunchofsortoffoundationalhtmlthatwecanbuildupon.
Somebodysaidthetitletostreamtests.
I'm gonnagetridofthescripttag.
SowhenwegettoJavascriptthescript, I willhavetobeveryimportant.
And I'm gonnagetridofmysoulsidebarthere, and I'm goingtojustkindofputinsomebasicHTMLelements.
AndifanybodyhasanysuggestionsforsomebasicHTMLsowecanmakethiskindofdynamicanduser, I guessour I guessifyouweredependent, definitelytosssomeideasinthechat I'm gonnastartoffwith.
Forexample, a divanddibsarewaysthatwecansortofdividetheirshortfordivisionWeaken, divideourWebpageinto, youknow, sortofverticalgroupingsofelementsandthatwithinmydiv, I'm goingtosay I'm gonnacreate a P tagerection.
I'm gonnacreatean H one, and I'm goingtosayCSStestwithinthatdiv.
Afterthat, I'm gonnacreate a paragraph, andthat's goingtosaythisissomeparagraphtextinmyday, thenlagbetweentheYouTubeliveandtwitchlife.
That's kindofnormal, I think.
ZenArk.
It's crossdreamingtomultipleservice's.
I thinkTwitchprobablygetsitmaybe a littlebitfaston, andthenYouTubegetsit.
YouTubestarted, I think a littlebitslower.
I thinkthere's somebitofdelaythere.
Theyhavetodo a coupleofthingsthatyoulike.
PreviewThestreamthenstarted, andthere's a fewstepsinvolved.
Yeah, that's that's, I think, fairlynormal.
I thinkit's notnormalforpeopletowatchbothofthesametimeandnoticeit.
So I thinkwhetheryou'rewatchingyoutowherethey'rewatchingtwitch, thetwoare.
Eitherway, you'refine.
Um, gonnacreateanotherdef.
Andtheninhere, I'm goingtosaythisisgonnabein h two.
I'm gonnasaythisis a secondblockandthen p m goingtosay, Here's a littlemoretextandthenmaybecreate a tablehereand I cantypethewordtableandthen I canhitTab.
Andthen I couldgodownhereandsay t hadwhichremember, that's wherewespecifytheheaderofourtabledesoloNorthandgivenmuchforfollowingandthen T bodyrighthereandwithin T head, I'llsaythandit'llsayname.
Umwell, sayimageorwhatever.
Andthen, um, Major, wecanmaybereusedsomeofthepriorcodethatwe, uhwedidlasttimewiththeHTMLtable V s codeforthewayitis.
Alex.
Yes, I agree.
Although I meanallofthemoderntechcentersAdamSublimeGScode.
Butif I refresh, wedoindeedsee, Andthisgivesyou a nicesortofillustrationofhowfaryourelementsextendinrealitysowecansee, eventhough, youknow, theCSStextSorryseesthistestandparagraphtextonlytakeup a littlebitofwitonourpage.
Itdoesn't actuallyincludesomeelements, andthat's kindof a differencebetweenusingborderequalsoneandstyleequalsandinsetting a borderhoweveryouwant.
But I couldveryeasilysetthistobe a 10 pixelssolidborderandthosethatknowourborderisgreenandmuchlargerthanitwasbefore.
Andif I did, um, I thinkit's dashed, knowsthatnowweget a verytacky, sortoflooking, dashedgreen, thickoutlinearoundourtable, butwehave a lotmoreflexibilitynow.
Before, wewerekindoflimitedthio.
Borderequalsone.
Eitherit's onoroff, butwegetkindof a weird, primitivelookingoutlineand, youknow, andalsoincludesthenestedelements, theTDs, thethisandonenotthe t ours.
SothisishowyouwouldusethestyletagareattributesrathersoyoucanuseinanyHTMLtagwhateverstyleattributeson a givenelementyouwantandthenspecifyas a stringthisbitofcodehereandthisisactuallytheseair, actuallyCSSproperties, CSSUm, yes, hesayspropertiesinthiscasebordercolor, background, color.
Andthere's a tonofdifferentpropertiesjusttogiveyou a senseofhowmanyThereare a websitethat I thinkisreallygreatlookingatisthemdn, theMozilladevelopernetworkpage.
There's a CSS, soitgivesyou a nicelittlehighleveloverviewofwhatitis.
Soherewehaveanintroduction.
Wehavetutorials.
ButifyougoovertotheCSSreferenceandit's crueldownhere a littlebit, thesearealltheCSSpropertiesthatwehaveaccesstointhelanguage, theentirelanguageandthere's a tonofthemandwewillnotbecovering.
Youknow, nearlyanywhereclosetothemajorityofthesewillbecovering a subsetofthesethatareoftenused.
Butthere's a tonofpropertiesthatyouknow, mostpeople, I wouldsay.
Unlessyou're a CSSfanaticwho's beenstudyingforyearsandhascommittedtheMiltonmemorysortofproactively.
It's a greatideatousethisfor a teambaitshould I doin a separatefileordirectlyintheelements.
Sogoodquestion.
Sowe'regonnastartgoingmoretowards a betterwayofdoingthis, usingwhatarecalledID's andclasses, andwe'regoingtotake a looknextatthestyletechsobacktomyHTMLpage.
I wanttogetridofallthisstuff, alloftheinlineproperties, orrather, theinline, theattributes, propertiesgoaheadandseewhere I hadallofthem, and I thinkthat's it, right.
I'm notmistaken.
Nope, hereaswell.
Sonow I havenomore.
Nowisjustpurehtmlandthisisimportant.
HavingyourHTMLseparatefromyourCSS, I think, isidealsothatyoucandecouple.
Hesortofthelayoutofyourpageversushowitlooks.
I thinkthatway, youknow, youcouldhaveonepersondesigningtheHTmoonepersondesigningtheCSS, Andthereare a lotofotherreasonswhyyoumightwanttodothis, whichwecantake a lookatlater, thesortofnextevolutionofhowwewanttoapproach.
AddingCSStoourWebpagesisgonnabewiththisthingcalled a styletag.
And a styletagisusuallyinthehat, actuallyalmostalwaysintheheadofyourHTMLpage.
ButJavaScriptoftenalsogoesintheheadifit's in a scripttag, ifit's actuallybuiltintotheHTMLpage.
Um, thestyletagis a containerwherewecanplaceallofourCSSratherthanhavingthembewithin a particularelement.
Andthisisgreat.
Sowhat I candioisandthisiswhereweactuallystartgettingintoourCSSsyntax, right, separatefromtheproperties, whichwassortofCSSsyntax.
ButthisismuchmoresoCSSinTexas, I cansay, forexample, andwe'llusethetableforasourfirstexample, I cansay, wheneverthere's a tableinmyHMO, Paigeand I dosomecurlybracketshere.
I wantthebasicallythesamethingthat I hadbefore.
I want a borderthat's 10 pixelsdashedgreen, right?
Andthecoolthingabout V s codeisactuallywheneveryouright, youknow, inthecontextoftheCSSpageorinHTMLpage, ifyouwrite a CSScolorandinthiscase, it's definedas a wordgreen.
Butwe'lltake a lookathowwecanmaybedefineourowncolors, usingeitherRGBorhexvaluesand a littlebit.
Butwehavethewordgreenhere, whichjustmeans, youknow, it's probablysomethinglikeRGB 02550 whichagainthat'llmakesensemoresense a littlebit.
Andthisis a greatsortofrepresentationofwhatyoucanaccomplishwithCSS.
JustjustCSS.
Nothingelsehaschanged.
ExceptfortheCSS.
Youcanseethisparagraphrighthere.
How?
Itsays a demonstrationofwhatcanbeaccomplishedthroughCSSbaseddesign.
Selectanystylesheetfromthelisttoe, loaditintothispage, andthennotesthatthissays a demonstrationofwhatcouldbeaccomplishedthroughCSSbaseddesignselectanystylesheetfromthelisttoloaditintothispage.
Soif I gobacktomypageandthen I uncommonthisbitofcodehereoutnoticethatwe'reseeingtableandwhat I'm positingisthatthisshouldapplytoalltablesbecausewe'renotbeingspecificaboutanyone.
Table.
I'm justsayingalltablesshouldhave a borderof 10 pixelsdashedgreen.
If I gobacktomypageandrefreshindeed, wedoseethatitdoesn't applyjusttothefirsttable.
Itgetsbothtablesandapplies a borderaroundthemandtunakillsquestionhowtohavethesamestyleonseventextboxes.
Youwoulddojustthis.
Youwoulddefineseventextboxesandyouknow, thesortofthenaiveishwaywhichwe'vedonesofar, isjust, youknow, useitbasedontheelementtype, whichistotallyfinefor a lotofcases.
Butyouwouldjustdefinesevendifferenttextboxesandthenyoujusthave a textareaselectorandinthatwouldencompassallsevenofthem, justbyvirtueofthefactthatit's goingtolookforallofthetextareas, thetextboxes, ifthatmakessense.
Sothisiscool.
Whenusingselectors, wecangraballofthegivenelementof a particulartype.
I havetwodibsinmyHTMLpage, so I canillustratethiswithgivesaswell I cansayDiv, Andthenmaybe I want a backgroundcolorofyellow, right?
Sousingverysimpleattributesarepropertiesrightnow, but I havetodibs.
So I havetheCSStestwiththisparagraph, andthen I haveThisis a secondblockandhere's a littlemoretext, right?
Soif I refreshnoticethatwedoindeedhaveyellowgoingaroundourentireelementandalsowhich I didn't realizeuntilnowthetablethatboththetablesthemselveswereinsidethisDivsonoticedthatthetablesthemselvesactuallygot a yellowbackground.
So, forexample, inthiscase, didisapparentelementtothis H oneandthis p tagrightthereinsidethediffjustlikethat's likepuzzlepiecesnestledinsideofanotherpuzzlepiecelikewe'veseeninscratchthediv.
Whenitgets a styledependingonwhatthestyleisright, itborderdoesn't necessarilyapplyinthesameway.
But, forexample, backgroundcolordoesthebackgroundcoloractuallyappliesalsotothis H oneandtwothis p tagright, becausethey'reinsidethediv, theirChildren.
AndthisissomethingweactuallylookatinourgamesclassinourFlappybirdlecture, I think, isthefirstlecturewelookat, whereyouseethebird, theflappybirdmovingandthepipesmoving.
RatherflabbyBirdalwaysstaycenter, butthepipesmoveandthatmakesitlook a zit.
Flappybirdismoving, andthenyouhave a backgroundinthedistancethat's movingevenslower.
That's what's calledParallaxscrolling, andit's a it's a sortofmakethehuman.
I thinkthatthereisdepthwhenthere's not.
Alltheseareisjust a seriesofimages, youknoweverythingiscompletelyflat, butassoonaswemovelefttoright a littlebitandthingsmoveatdifferentspeeds, ittricksthehumaneyeintothinkingthatthere's actuallydepththeresoreallycooleffectthatcouldbeapplied.
Andif I wantthesamethingtohappenformyredtableandyouspecify a 10 pixeldashedredborder, they'reright, and I canactuallygetridofthistabletagnowbecause I don't reallywantanythingatthemoment, uniformlydonetoallmytables.
I justwantmygreentableinmyredtable.
The I D shouldonlybeusedonce.
Classescanbeusedmanytimes, saysJoeBond.
Correct.
Thatiscorrect.
NownoticethatinthestyleofChristmaswedohave a greendashborderaroundthefirsttable, whichwegavethe I.
D greentable, andthesecondtablenowhas a redborderaroundit.
Intheveinoftheredtable I did.
AndtoJapan's pointgift, thisiscorrect.
Ideasshouldonlybeusedonetime.
Youshouldhaveonespecificelementthathasan I d.
Andifyouwant, Youknow, forexample, maybe I wanted a coupleofgreentables, right?
Letmegoaheadandcopy.
Maybe I want a coupleofredtables.
I'm gonnacopythistablehereandpasteitdownbelow.
Andyouknow, now I havean I d.
Inbothplaces, butthat's notreallyeconomical.
Andactuallyoffhand, I don't knowifthatwillwork.
That'llstillwork.
Soyoucanstillhavetwothings.
Havethesame i d andthatitworksfine.
Butit's notgoodpractice.
Typically, whatyou'lldoisinsteadusewhat's called a class, and a classismeanttobeusedacrossmultipleelements, multipleelementsthatsharethesamephysicalcharacteristics.
Yeah, and a lotofcasesyouwon't havethesameanchortaginmultipleplaces, you'lltypicallyonlyhaveitasoneparticularthing.
Thefrontanddesigneratmylastinternshipdidthesame.
Andourmentor, Satin, explainedwhyit's a badpractice.
Yeah, no, itmakessense.
Okay, soclassesand I d.
S.
Weunderstandhowthatworks.
Welookedatthestyletag, whichisgreat.
Welookedatselectors.
Um, nowlet's goaheadandmaybeget a littlebitmorefancywith R h t m o.
Somaybe I wanttostyleWe'lldothis.
We'llsayattheverytopofmypage.
I'm gonnahavean H onethatsaysCS 50 onTwitch.
I'm gonnachangethis h onetobeanageto, becausegenerallyyoushouldonlyhaveone h oneinyourapplication, TomballotOrkindlyexplainthelaststreamhowthisaffectscertainpeoplewith, um, accessibilityissuesmaybeblindpeoplethatwe'rereadingthroughthrough a particularreader, andtheywanttogettotheheaderofthepage.