Thisparagraphisreadallthe P tagshavenowchangedthetexttoreadsoforthischallenge.
We'regoingtotakeouttheinlinestylehere, and I'm goingtoaddsomestyletothisblockuphereinsteadofstyling.
P tag's running a stylethat h twotagsand I'm goingtomakethemallblueSo I'm gonnaputColorblueNowLetmeopenupthebrowserandwe'llseewhatthatlookslikeif I refreshandyoucanseetheagetoisnowblue.
Put 16 p x andnowif I showthebrowserhere, we'llseethatalltheparagraphsare 16 pixelsthatwe'vejustincreasedeverythingto 16 pixelsfortheparagraphsyoucanset, whichfontinelementshouldusebyusingthefontfamilyproperty.
Nowyoucanuse a typeorstyleofthoughtlikeSarahIfSanSierraformonospaceoryoucanputintheexactfund.
Sointhischallenge, we'regonnamakeallthe P elementsmanospace.
Soif I addHelveticarighthere, and I canactuallyjustmake a listoffontsrighthere, Soinfontfamily, whenyouhave a listherefirstittriesthefirstfont, butthatone's unavailable.
Itwillgotothenextfont.
Sowhenyou'remaking a listoffontfamilyfunds, youalwayswantthelastonetobe a genericfont.
Andif I refreshmypagehere, youcanseeitmakes a circle.
Youcansetanelement's backgroundcolorwith a propertycalledbackgroundcolor.
Sohere's anexample.
Let's setthebackgroundcolorofthe H twoelementsbackgroundcolor, and I'm goingtochangethistoblue.
Soif I openup, mybrowserwillseethatthebackgroundisblue.
I'm gonnamake a newclass, andthenewclassisgoingtobecalledsilverbackgroundsilverbackgroundandyouguessedit.
It's goingtohave a silverbackground.
So I'm gonnaputbackgroundcolorsilver.
Now, remember, I alsohavetoapplyitsomewhere.
I havetomakesomethingusedthatclass.
Soforthisdevelop a classequalssilverbackground.
Now, if I refreshhere, youcanseewehave a silverbackgroundhere.
Wedon't needthisbackgroundcolorblue, so I'lltakethatoffhereandrefreshitonemoretime, andthat's howit's supposedtolook.
We'vetalkedaboutstylingspecificelementslikethis.
Andthenwe'vealsotalkedaboutstylingclasses.
Youcanalsostylebasedon I d andideassimilarto a class.
Excepteachelementisonlygonnahaveone I d classes.
Youcanputon a lotofdifferentelements.
Soletmeshowyouhowtoapplyan I d toanelement.
If I justgodowntothisformhereand I'm justgonnaput i b equalscatphotoform.
Andjustlikethat, it's notgonnachangetheappearanceatallbecausewehaven't styleityet, Butnowwecanusethe I d toaddCSSstylesorweakenreferenceitinJavascript.
Inthelastsectionwelearnedabout I d s.
Nowwe'regonnalearnaboutstyling I d.
S.
I'llusethisacetoasanexampleandan i d.
Ofheadingbeaterstyling I d.
S.
It's similartoinyourstylingclasses, butwearegoingtousein a hashmarkinsteadof a period.
So I'm gonnaputheadinghere.
Um, letmeformatthislittlebetter, soyoucanseenormallyfortheclansthatstartedtheperiodforan I D.
It's gonnastartwith a hashmark.
So I amgoingtoputColorGreen.
Now I wanttoshowyousomethingsoyoucanseethatthis h twohas a classofredtechsand a headingandideaofheading.
Sowehavetheredtextandtheheading.
Soisitgonnaberedorisitgonnabegreen?
Well, let's openthebrowserandfindouthere.
YoucanseeitisgreenbecauseCSSputs a higherpriorityto a I.
D s thanclasses.
Andas a reminder, youshouldonlyhaveone I d perelement.
Wealreadyhavethe i d downhereontheformideaofcampphotoform.
Andthenif I refreshmypagehere, youcanseethattheseboxesarethesamesizeandelementsmargincontrolstheamountofspacebetweenanelement's borderandthesurroundingelements.
Soif I justrefreshmypagehereandthecheckboxesarestyledSofar, we'vebeensettingmarginsandpaddingisusingpixels p x e ofthisexampleNega 25 PXorpixelsTheseareabsolutetypesoflength, soabsolutetypesoflengthincludelike i m foranswermmmillimeters, theseairalltiedtophysicalunitsoflength.
Butthere's alsorelativeunitsoflength, suchas E.
M and R E M andtheseairrelativetoanotherlengthvalue.
Forexample, E M isbasedonthesizeofanelement's font.
Sorememberstartingwiththedollarstorewith 1/2 shineorpoundsignand I'm gonnaputorangetextandherewe'regonnaputcolororangeAndnow I'm gonnashowthebrowserHerewerefreshandyoucanseeit's orangetextbecause I d theirspecificYouareonlysupposedtohaveone I D perpage.
Soif I refreshhere, weshouldseespaceinbetweeneachcolumn.
Inthelastchallenge, welearnedaboutGridcolumngap, youprobablywon't besurprisedtolearnthatthere's also a gridrowgap, soitworksjustthesamegridrowgap, and I'llmake a gapbetweentheRose.
Thiscasewillputfivepixelsbyrefresh.
Hereyoucanseethatthereis a spaceinbetweentherowshere.
ThegridGappropertyis a shorthandpropertyforusingthegridrowgapandgridcolumnGappropertiesallatonce.
Nowwe'lllearnhowtoplaceitemsin a specificspotinthegridarea, Soifwewanttosetitemfivetobein a specificspot, willusethegridareaproperty, sogridareaandthenwejustputoneofourcustomsnamethatwedefinebelow.
Forinstance, ifwesetthistwoheaderon, I refreshhere, you'llseethenumberfivehaspoppedoutofitsnormallocationandfillsuptheentireheader.