Whatyoucandoisyoucancreate a class, thenwheneveryou'rerightnow, theHTMLcode, wheneveryouputthe H onetagorthe P tag.
Youcanthensayit's a classequalsandthenwhateverclassyoucreatedwithinyourCSS, andthenthattagwillgainoftheattributesofwhateveritisyouputintotheCSS.
Soifyouwanteverythingwiththatclasstobe a certainfont, itwillbethatfun.
Ifyouwanttobe a certaincolorwillbethecertaincolor, soonandsoforth.
Well, youcanalsodothesamethingwith I.
D.
So I d.
S areusefulthingwithinHTMLWebpages, mainlybecausewhattheydoistheyallowyoutodowhatarecalledanchorlinkswithin a singlepageofHTML.
It's a lotofpeopleunderstandhownormalhyperlinksworks.
Allright, ifyoucreate a hyperlinkon a page, normallywhatyou'redoingisyou'reactuallylinkingtoanotherWebpagewithintheoverallsite, oryou'relinkingtoanentirelydifferentsites.
Honestly, what I'm goingtobeshowingyouhowtodobasicallyassignedCSSattributestoan I.
D.
Today.
I thinkmostpeoplewouldargueit's actually a betterideatoideatoassigntheseattributesto a classsobasicallycreating I D and a class.
But I justwanttokindofshowyouhowthisworkswithideas.
Ifyou'reusingIEDswithinyourwebsiteanyway, maybeinsteadofcreatingclassesandnumerousotherdifferentthings, maybeifyoujustsimplyassignattributesto a spittoyourideasinstead, thismightbe a usefulwayforyoutodothings.
Sowiththat, let's goovertothecomputer, and I canshowyouhowthe I.
D.
S andhowassigningCSSCSSattributestothoseideaswork.
Here.
Wearebackatmydemonstrationmachineagain.
I amusing a Macbookproagainforthesebasickindofcodingclasses.
I wouldliketouse a basicaskingtexteditorjusttoshowyouthat's allyouneedinordertodothistypeofthingintheMacworldusedtextatit.
Sowiththis, it's intheexactsamefolder a CZThisparticulardocumentisso I couldjustputthenamethereifitisin a differentfolderforsummaries, andyoujusthavetoputthefullfilepaththere.
Youclose.
Youputthatlittle, uh, forwardslashthereandyouclosethelink, andsothislinksustothe i d styledotCSS.
Now, if I gooverhereand I take a lookatthe I d stylethatCSS, wecanseethat I'veputin a fewthingsherenow.
The 1st 30 thingsthat I'veputinhereis I'veputinsettingsforthreeideas, sowhenyou'redoingideaswhenyou'redoingideas, you'regoingtoputthatpoundtosignthathashsigninfrontofit.
You'redoingclasses.
Youputtheperiodsigninfrontofitagain.
Justoneofthosesimplememorizationthings.
Justremember, ifyou'regoingtobecreatingattributesfor I d.
S, youput a hashsigninfrontofthe I D.
Ifyou'regoingtobedoingattributesforclasses, youput a periodSinanfromthenameoftheclass.
Sowiththeseagain, I amsimplycallingthese I d one I d toor I d three.
Youcouldnametheseideas.
Whateveryouwanttonamethem.
I'm justbeingsimple.
What I'vedonehereisfor I d one.
I'm simplysayingthatthebackgroundcolorshouldbeyellowthat I'm doingfor i d tothebackground.
Colorshouldbepink.
Andfor i d three, I'm sayingthebackgroundcolorshouldbegreen.
Themainthingtorememberhereiswhenyou'redealingwith I d.
S againpoundorhashsigninfrontofthenameofthe I D.
Andthenwhenyou'redoingclasses, youput a periodinfrontofthenameoftheclass.
Thenwe'regonnagooverhere, actuallytake a lookattheHTMLdocument, andthisis a bitof a messjustbecause I wantedtogiveyouanexampleofwhy I desireusefulasanchorpoints.
Solet's goinfirst.
Justkindofwalkthroughthis.
Thefirstthingthat I'm showingyouhereas I'm assigningan i D.
He I d.
Hereof I d onesimplytothis h onetext.
Soallthisisis 81 textandthisisgoingtobe I d one.
Soif I wantedtocreate a hyperlinkhere, itwillcomedirectlyhere.
Thenthenextthingthat I doitdoneis I created a division.
Wehavenormal p totaghere, buteverythingwithinthisparticulardivwillgetthevaluesfor I D to.
Soifwegooverhere, youtake a lookat I d tosew.
Everythingherewillbeinpink.
Sotheageoneuphere, thiswillbeinyellow.
Allofthiswillbeinpink.
Thenwe'regoingtogodownheretodoanotherdeftag.
Thiswillbefor I D three, so I d three I's goingtobethatbackgroundcolorofgreen.
Butthenherewhat I'vedoneisfortheactualtexttags.
I haveaddedclassessothebackgroundwillbegreenandthen h onewillhavetheattributesofclassone, andthe P willhavetheattributesofclasstoThefinalthingthat I'vedonehereisjusttoshowyouhowtheanchorthingsworkwithan I D.
Incaseyoudon't knowis I'vecreated a hyperlinkwithinthisdocumentto I d four.
Sothishyperlinkbasicallyit's an a ref.
Itlooks a lotlike a normalhyperlink.
Theonlydifferenceisyou'regoingtodothat.
Pound I d.
Four.
Sothisiswherethatpoundcomescomesinagain.
You'llnoticeherewhentheydothediv I d.
I simplydidthe I d, too.
I didnotdothepoundsignhereforthe A hair.
If I actuallydothepoundsignand I justsaythisis a linkto I d four, thenall I didas I put a lotofperiodsin a lotofbreaks.
Basically, all I'm doinghereisactuallyjustcreating a bigfileso I canactuallygosomewhere.
Andwhen I clickonthatlinkthat's goingtocomedownheretothisDiv.
I d i.
D four.
Sobasically, when I clickonthatlinkthat's goingtocomedownhere, andthisisjustgonnashowyouthatideascouldbeusedforhyperlinks.
I thenaddedsomemoreperiodsandbreaksjustsoitflusheseverythingoutanditactuallyrunsprettysmoothlyagain.
Thenyou'regonnacomedownhere, You'regonnasee a ref.
Thisisgoingtopointtothat I d fouragainifwe'relookingheresowecanseethisis a linkto I d four.
I canclickonthisandseethatjumpsusdowntowhere i d fourisinthepage.
Andagain, allyou'reseeingisperiodsherebecause I'm justkindofsimulatingthatthiswouldbe a largepickandagainjusttogiveyouthat I d ideaifyoudon't knowwhatan I D isusedforfortheseanchorpointsin a pagejusttogiveyou a bitof a cluehere.
Ififsomebodyactuallyprintedoutthatpaidyouonlylike 50 pageslong, sohaving a lynxinternaltothatpageprobablymakes a lotofsensenow.
OneofthethingsthatyoudohavetobethinkingaboutintheCSSworld, like a lotofthingsincoding, isyoudohavetothinkaboutthemostappropriatewaytoassigntheCSSattributesagain.
Ifyou'redealingwith a largeolddocumentandyousimplywanttoaddsomecolors, yousimplywanttoaddsomepizazzto a andit's alreadygotthisideastructurebuiltintoit.
Thenfrankly, maybe, simply, youknow, associatingthe I.
D.
S withsomeCSSattributesandvalues.
Maybemaybethat's theeasiestwaytogo.
Okay, I'vegot I'vegot 20 anchorlinks.
I'vegot 20 ideasinherealready, so I'm justgoingtoassignvaluestothose 20 I.
D s andwashmyhands.
I'm notdoing a majorrevampofthissite.
I'm notbuilding a sitefromthegroundup.
I alreadyhavesomething.
Italreadyhas I d s.
Thisistheeasiestwaytogo, right?
ThatmightbethebestwaytogoAnotherhand.
Ifyou'rebuildingthissitefromthegrounduporifyou'redoing a majorrevamp, maybeitwouldbebettertoassigntheseattributesagainbasedoffofclassesorbasedoffofotherthingsthatitwillbeshowingyouaswe d'oh.
Soifyouwanttotheseclassestocontinuetostickaroundandyoufindthemtobevaluable, pleasethinkabouteitherbecoming a monthlymemberordonating a fewdollarsforthisproject.