So I'm goingtobegivingyousomebasicexamplestodaythatareprobably a littlebitofnobrainers.
I'm goingtoshowyouhowtocreate a square, goingtoshowyouhowtocreate a rectangle.
I'm goingtoshowyouhowtocreate a circle, and I'm goingtoshowyouhowtocreateanovalpast, thatwe'regoingtouse a cheatsheetbecausethat's whatallgoodtechnologyprofessionals d'ohwhenthingsstarttoget a littlebittoocomplicated.
Sooneoftheresourceis I'vetalkedaboutbeforethatyoushouldbeusingifyouuselearningCSSis a websitecalled W threeschoolsdotcom.
Thenall I havehereisjust I havefourdifferentdibswithspecificclasses.
SoDivisbasicallywhereyouwhereyoukindofcreate a sectionyoucreate a divisiononyourHTMLdocumentonBasicallywhatwe'regoingtodohereiswe'regonnacreatethatdivItisgoingtobe a shapeandthenit's goingtohave a specificbackgroundcolorsoitactuallyshowsupandwecanseeit.
So I have a div.
Theclassforthisisgoingtobe a square.
Itwasgonnabe a square.
Wedon't putanythingwithintheDIVitself.
Youcouldputsometexthereifyouwantedto, butwe'renotputtinganythingbecauseall I wantis a basicshape.
Thismightbe a littlebitnewnewtoyou, butitactuallyuseswouldhavealreadyshownyouin a previousclass.
Sowiththisliterally, whatwe'regoingtobedoingiswe'regoingtobe a roundingthesquare, right?
Sobasically, imagineyouhave a square, andthenyou'retryingtoaroundtheedgesofthesquare, andthenyouroundtheedgesofthesquaresomuchthatitbecomes a circlethatlogicallyisliterallywhatwe'redoinghere.
Sothefirstthingyou'regonnadohereisyou'regoingtodothesamethingthatyoudidwhenyouhad a square.
Yougottamakeit a wit.
The 40 pixelsgonnagethighto 40 pixelsandgiveit a backgroundcolorofgrayliterallyexactlywhatwediduphere.
Thedifferenceisisthatwe'regoingtousetheborderradius s o.
I did a classtalkingaboutborders, andoneofthewaysyoucanformatyourimagesisbybasicallygivingroundedborders, andthat's whatthisborderradiusdoes.
Andsowe'reactuallygoingtogivethis a borderradiusof 50%.
Soifyougiveit a borderradiusof 50% basicallythatmeansitroundsalltheborderstothepointthatitturnsinto a circle.
Wegodownhere, wetake a lookattheoval.
Soovalistheexactsamethingis a rectanglewithof 100 pixels, heightof 40 pixels, backgroundcolorofgray.
Ifwegobackjusttogiveyou a littlebitofexampleforhowthiswouldwork, let's say I onlysetthecircleto 25% fortheborderradius I couldfile.
I coulddosave, andthenthismightbesomethingyou're a littlebitmoreaccustomedto.
Sobasicallysee.
Sowhatthisisisthis a squarewithroundedbordersandallwe'redoingasweincreasethepercentageoftheroundedborderswerejustslowly, slowly, slowlyturningitinto a circle.
Wedorefresh, See, nowit's a rectanglewithroundedborders.
Essentially, that's literallyallwe'redoinghere.
We'rejustroundingtheborderstosuch a degreethatitthenturnsandtoanoval.
Sothosearethebasicexamplesofsquare a rectanglecircleandovalpastthat, thoughpastthat, Tobeclear, youcoulddo a lotmorereallycoolthings.
That's whereyougotosomesightlike W threeschoolsdotcomAgain, oneofthethingsyouhavetorememberencodingisthatonceyoucreate a basicwaytodosomething, otherpeoplecansimplycopyandpasteitagain.
There's noreasontoreinventthewheelallthetime.
Andsoagain, that's whatThat's why I recommendyouhave a bookwhereyoucouldgotosomethinglike W threeschoolsbecausethenyoucanhaveanideainyourheadaboutwhatyouwanttodowithCSS, andthenyoucouldjustgoonresearchitandseeifsomebodyelsehasdoneitlikeyoumaybesittingheregoing, Buthell, I don't want a rectangle.
I want a trapisoIdso I cangohereand I canclickonthis.
Thefactofthematteris, whateveryou'regonnabecreating a project, theregonnabe a lotofweirdthingscomingupagain?
Whywouldyouneed a trap?
Isalwayslike, Why?
Whydoyouneedtomemorizehowtocreate a trapresortandCSS?
Howoftendoesthiscomeup?
Butifyouknowthatwhenitdoescomeupatsomepoint, youcanjustgoto W threeschoolsorsomethingelseagain, copypastecode, dumpitintoyourprojectin a way, Ugo, thenthatallowsyoutokeepyourrollingthroughtheprojectwithouthavingtolearnsomethingthatit's notgonnamatter.
Attheendofthedaythatyouhavememorizedtheimportantthingtounderstand, though, whenyoustartdoingcopyandpasteandthisisimportantwhen I wastalkingaboutdoingthiswithCSSversusotherprogramminglanguagesisthatyoudoneedtobeabletoauditthecode.
There's a differencebetweenwritingthecodeandreadingthecode.
It's kindoflikeit's kindoflikeunderstanding a foreignlanguage, rightwhenyougoto a foreigncountry, manytimesismoreimportantthatyouunderstandwhatpeoplearesayingthenbeingabletosaveyourself.
Ifyouunderstandwhatthey'resaying, youcanprobablyfind a waytocommunicatewiththemtogetsomethingaccomplished.
Soifyouwanttotheseclassestocontinuetostickaroundandyoufindthemtobevaluable, pleasethinkabouteitherbecoming a monthlymemberordonating a fewdollarsforthisproject.