Yuav Ua Li Cas Tig Ib Qho Hloov Chaw Ntawm Nplooj Ntawv

Cov txheej txheem:

Yuav Ua Li Cas Tig Ib Qho Hloov Chaw Ntawm Nplooj Ntawv
Yuav Ua Li Cas Tig Ib Qho Hloov Chaw Ntawm Nplooj Ntawv

Video: Yuav Ua Li Cas Tig Ib Qho Hloov Chaw Ntawm Nplooj Ntawv

Video: Yuav Ua Li Cas Tig Ib Qho Hloov Chaw Ntawm Nplooj Ntawv
Video: Lo lus, lub nplooj sawv, dai khoom cov ntaub ntawv 2024, Hlis ntuj nqeg
Anonim

Txoj kev yooj yim heev uas tig cov ntsiab lus ntawm nplooj ntawv lub vev xaib - tsuas yog thov ob peb css cwj pwm. Cov kev paub nrog zaj lus qhia no yuav tso cai rau koj tso tus kiv cua daim npav tsis raug nthuav tawm, tawg nplooj lossis nplooj duab stylish hauv ib qho album ntawm nplooj ntawv. Cov zaj lus qhia muaj ib qho piv txwv ntawm kev siv ntawm kev thaij duab yees duab thiab coj mus rau hauv cov kev daws rau txhua qhov browser niaj hnub.

Yuav ua li cas tig ib qho hloov chaw ntawm nplooj ntawv
Yuav ua li cas tig ib qho hloov chaw ntawm nplooj ntawv

Nws yog qhov tsim nyog

Plaub daim duab nce mus txog 450px dav

Cov Lus Qhia

Kauj ruam 1

Cov piv txwv no yuav tsom mus rau tsim ib nplooj ntawv stylish nplooj nrog cov duab tig.

Kuv npaj ua ntej cov duab (dav 400px) nrog chaw nyob:

Yav tom ntej, peb yuav muab cov npav ID rau cov duab raws li lawv lub npe.

Kauj ruam 2

Ua ntej, peb yuav npaj lub block rau peb cov yees duab album siv div div, thiab tseem ntxiv cov duab rau nws siv img lossis (txhua daim duab yuav tsum tau muab ntim nrog nws div div), zoo li qhov no:

Thov nco ntsoov tias peb tau muab ib lub cim rau qhov block -. Los ntawm cov cim, peb tuaj yeem xa mus rau block siv css.

Kauj ruam 3

Tom ntej no, koj yuav tsum tau teeb tsa css cwj pwm rau cov block. Npe cov qauv: "txoj haujlwm: tus txheeb ze;" - yuav teeb tsa lub keeb kwm ntawm sab laug sab laug ntawm peb qhov thaiv; "npoo: 50px pib;" - yuav teeb tsa indentation ntawm peb block "50px" saum toj thiab hauv qab tus so ntawm nplooj ntawv ntsiab lus, raws li tau teeb tsa lub cim cia ua haujlwm tsis zoo rau sab xis thiab sab laug, yog li kho peb lub thaiv hauv plawv; "qhov dav: 900px; qhov siab: 650px;" - yuav teeb qhov dav rau 900px thiab qhov siab txog 650px, ib ntu.

Cov kev cai teev tseg ntawm cov yuav tsum tau muab tso rau hauv txoj kev no:

#photo_page {

txoj hauj lwm: tus txheeb ze;

paj tau paj: 0 auto;

dav: 900px;

qhov siab: 650px;

text-align: chaw;

}

Nco ntsoov siv "#photo_page" - qhov no yog qhov peb xa mus rau daim npav ID.

Kauj ruam 4

Tam sim no peb yuav muab cov qauv dav dav rau txhua cov duab hauv block_ photo_page block. Cov no yog cov pob kws sib npaug, grey ciam teb, dawb keeb kwm yav dhau, padding, thiab poob duab ntxoo.

Qhov no yuav tsim cov duab thaij:

#photo_page img {

ciam teb-vojvoog: 7px;

ciam teb: 1px khoom grey;

tom qab: #ffffff;

padding: 10px;

lub thawv-duab ntxoo: 2px 2px 10px # 697898;

}

Nco ntsoov siv "#photo_page img" - qhov no yuav xa mus rau tag nrho cov duab hauv lub photo_page block

Kauj ruam 5

Nws kuj tseem ceeb ntxiv qhov luv luv style li no:

#photo_page div {

ntab: laug;

}

Nws shrinks tag nrho cov blocks sab hauv lub photo_page thaiv rau sab laug.

Kauj Ruam 6

Cov theem nrab ntawm tshooj lus tam sim no tau ua tiav. Yog tias koj qhov haujlwm zoo li cov duab hauv lub vijtsam duab, tom qab ntawd koj tsis tau ua yuam kev thiab tuaj yeem mus rau kauj ruam tom ntej.

Ib nrab theem nrab hauv kev tua ntawm cov piv txwv
Ib nrab theem nrab hauv kev tua ntawm cov piv txwv

Kauj Ruam 7

Tam sim no peb tig tig tig cov duab sib tw. Rau qhov no peb xav tau lub pauv hloov. Lub sijhawm no, hauv nws daim ntawv dawb huv, nws tsis yog siv, tab sis tsuas yog nrog cov lus ua ntej rau txhua qhov browser thaum pib, zoo li no:

-webkit-transform: tig (muaj nqi);

-moz-hloov: tig (muaj nqi);

-o-hloov: tig (muaj nqi);

Nov yog hom kab kev sib hloov rau browsers: Google Chrome, Mazilla, Opera (feem). Hloov los ntawm lo lus "tus nqi", peb yuav ntxig tus lej nrog deg tom kawg, zoo li no:

90deg - tig 90 degrees raws moos.

-5deg - tig -5 qib rov ntsuas.

Lwm yam.

Kauj ruam 8

Cov qauv rau duab photo_1:

# Duab_1 {

-webkit-transform: tig (5deg);

-moz-hloov: tig (5deg);

-o-hloov: tig (5deg);

}

Thawj daim duab yog tig 5 qib.

Kauj Ruam 9

Cov qauv rau kev yees duab photo_2:

# Duab_2 {

-webkit-transform: tig (-3deg);

-moz-hloov: tig (-3deg);

-o-hloov: tig (-3deg);

}

Daim duab thib ob yog tig-3 degrees.

Kauj ruam 10

Cov qauv rau duab photo_3:

# photo_3 {

-webkit-transform: tig (-2deg);

-moz-hloov: tig (-2deg);

-o-hloov: tig (-2deg);

}

Daim duab thib peb yog tig -2 qib.

Kauj ruam 11

Cov qauv rau kev yees duab photo_4:

# photo_4 {

-webkit-transform: tig (8deg);

-moz-hloov: tig (8deg);

-o-hloov: tig (8deg);

}

Daim duab plaub yog tig 8 qib.

Kauj ruam 12

Cia peb pom yuav ua li cas koj tuaj yeem kho qhov chaw ntawm cov duab. Piv txwv li, koj xav offset thawj daim duab 20px los ntawm sab saum toj thiab 10px los ntawm sab laug. Hauv qhov no, koj yuav tsum siv hom kab npoo. Nov yog txoj kev raug siv nws rau peb kis:

# Duab_1 {

cov npoo: 20px -10px -20px 10px;

-webkit-transform: tig (5deg);

-moz-hloov: tig (5deg);

-o-hloov: tig (5deg);

}

Thov nco ntsoov tias thawj tus nqi ntawm cov style yog cov paj saum toj kawg nkaus; qhov thib ob yog qhov pib nkag rau sab xis; qhov thib peb yog qhov khoob tawm hauv qab; plaub - sab laug indent.

Tseem ceeb: hauv peb qhov xwm txheej, cov npoo hauv qab yog sib npaug nrog tus nqi tsis zoo ntawm cov npoo sab saum toj. Yog tias koj pom qhov chaw dawb hauv qab daim duab ntawm koj nplooj ntawv, sim nkag mus rau hauv qab ntawm daim duab txawm tias ntau dua qhov tsis zoo.

Kauj ruam 13

Cov haujlwm tiav, Kuv muab ib lub vijtsam (coj mus rau hauv tus lej hloov ntawm kev poob ntsej muag ntawm thawj daim duab tau piav qhia hauv Kauj Ruam 12)

Ntxiv indentation style rau cov duab uas tsis yog nyob hauv txoj hauj lwm kom haum koj.

Pom zoo: