Cascading Style Sheets (CSS) ntaus cim yog feem ntau siv los hloov cov xim ntawm hyperlinks hauv cov nplooj ntawv web. Cov tswv yim ua haujlwm tsis tshua zoo rau cov teeb meem no yog hom lus HTML (hyperText Markup Language - "hypertext markup language").
Nws yog qhov tsim nyog
Cov txuj ci yooj yim ntawm HTML thiab CSS hom lus
Cov Lus Qhia
Kauj ruam 1
Npaj lub styling thaiv rau hyperlinks. Hauv nws daim ntawv yooj yim tshaj plaws, nws yuav zoo li qhov no: a {xim: Ntsuab} Ntawm no "a" yog hu ua "xaiv", uas qhia tau tias cov lus piav qhia hom ntsiab lus hauv kab ntawv yuav tsum siv rau tag nrho cov kab txuas hauv daim ntawv. Ntsuab txhais cov xim ntawm qhov txuas; qhov no yog txhais tau meej heev ntawm cov xim thiab tsis tshua muaj siv. Ntau ntau zaus, qhov "pseudo-chav kawm" ntxiv rau qhov kev xaiv " "- nws yog daim ntawv lo uas tso cai rau koj los qhia qhov style ntawm qhov txuas hauv peb lub xeev sib txawv.
Kauj ruam 2
Siv qhov txuas pseudo-chav kawm kom haum tus qub (tsis nquag) lub xeev ntawm qhov txuas. Tej zaum nws yuav zoo li qhov no, piv txwv: a: txuas {xim: Ntsuab}
Kauj ruam 3
Siv lub pseudo-chav hover los qhia meej li cas txuas yuav tsum tshwm sim ntawm yuj. Piv txwv li: a: yuj {xim: txiv qaub}
Kauj ruam 4
Siv daim ntawv mus xyuas pseudo-chav kawm los qhia txog hom kab txuas ntawm qhov txuas txuas mus xyuas. Piv txwv: a: xyuas {xim: DarkGreen}
Kauj ruam 5
Ua ke txhua peb lub xeev ua ib hom style piav qhia. Qhov saib ntawm HTML code uas muaj CSS cov lus piav qhia ntawm cov yeej tuaj yeem, piv txwv li, zoo li no:
a: txuas {xim: Ntsuab}
a: xyuas {xim: DarkGreen}
a: yuj {xim: txiv kab ntxwv}
Ntawm no, qhov qhib thiab kaw HTML style cim npe qhia qhov browser qhov twg cov lus piav qhia style pib thiab xaus, thiab nyob nruab nrab ntawm lawv yog cov lus piav qhia ntawm kev txuas tus cwj pwm hauv peb lub xeev.
Kauj Ruam 6
Cov qauv uas siv sab saud qhia tsuas yog cov xim tus yam ntxwv, tab sis lwm cov cwj pwm tuaj yeem suav nrog hauv qhov kev piav qhia. Piv txwv li, yog tias cov nplooj ntawv tsim qauv hais tias qhov sib txuas tsis yog qhov kab hauv qhov xwm txheej (tsis nquag), tab sis muaj kab hauv qab thaum tus chij dhau lawm, tom qab ntawd cov cai tuaj yeem hloov kho raws li hauv qab no:
a: txuas {xim: Ntsuab; kho kom zoo nkauj ntawv: tsis muaj;}
a: xyuas {xim: DarkGreen; kho kom zoo nkauj ntawv: tsis muaj;}
a: yuj {xim: Txiv qaub; kho kom zoo nkauj ntawv: kos kab hauv qab;}
Kauj Ruam 7
Yog tias koj xav hloov cov xim ntawm qee qhov txuas hauv nplooj ntawv, thiab tawm tas nrog cov chaw pib, tom qab ntawd ntxiv cov cwj pwm hauv chav kawm rau cov cim npe ntawm txhua qhov txuas tau raug hloov. Piv txwv li, npe lub chav kawm ua haujlwm tshiab no rau cov tshiab. Tom qab ntawd cov kab ntawv txuas yuav zoo li qhov no: kab ntawv txuas Cov chav kawm tib lub npe yuav tsum raug ntxiv rau cov qauv piav qhia:
a.newLinks: txuas {xim: Ntsuab; kho kom zoo nkauj ntawv: tsis muaj;}
a.newLinks: xyuas {xim: DarkGreen; kho kom zoo nkauj ntawv: tsis muaj;}
a.newLinks: yuj {xim: Txiv qaub; kho kom zoo nkauj ntawv: kos kab hauv qab;}
Kauj ruam 8
Tso cov qauv ntawv cim qhia npaj los ntawm cov piv txwv tau piav qhia saum toj no hauv lub header ntawm nplooj ntawv - nruab nrab ntawm thiab cim npe. Yog tias tsim nyog, ntxiv chav qhia rau ntawm kab ntawv txuas nrog lub npe siv hauv cov lus piav qhia hom. Tom qab ntawv khaws nplooj ntawv hloov kho thiab cov txheej txheem rau hloov xim ntawm cov hyperlinks yuav ua tiav.