Yuav ua li cas kom lub vev xaib teb: cov lus qhia

Cov txheej txheem:

Yuav ua li cas kom lub vev xaib teb: cov lus qhia
Yuav ua li cas kom lub vev xaib teb: cov lus qhia
Anonim

Kev siv internet siv los ntawm cov khoom siv hluav taws xob tau nce ntxiv txhua hnub. Cov neeg siv niaj hnub xav tau cov peev txheej nrog qhov yooj yim tshaj plaws interface rau lawv. Ib yam nkaus li, kev hloov pauv hloov ua rau nws muaj peev xwm ua tau raws li qhov xav tau no, vim nws tso cai rau koj hloov cov nplooj ntawv web rau cov yam ntxwv ntawm cov khoom siv txawb.

Cov lus teb, tseem hu ua mobile-phooj ywg, suav nrog kev ua qee yam haujlwm txhawm rau tsim cov nplooj ntawv web uas tuaj yeem hloov kho rau cov kev daws teeb meem sib txawv.

Ntau xyoo dhau los, cov neeg hauv thaj teb tau tsim ntau lub vev xaib nplooj ntawv kom cov peev txheej tuaj yeem tso saib tau zoo ntawm 'ktrnhjyys[' gadgets nrog cov yam ntxwv ntawm lub qhov rais sib txawv. Qhov no yog li cas layout designers ua hauj lwm txog 2010. Tom qab ntawd lub tswv yim ntawm yuav ua li cas kom lub site adaptive hloov dramatically. Tom qab ntawd, txhawm rau ua txoj haujlwm no, siv cov lus tshwj xeeb programming - JavaScript.

Dab tsi yog lub vev xaib teb
Dab tsi yog lub vev xaib teb

Yuav ua li cas kom lub vev xaib teb ntawm txhua qhov screencov khoom siv mobile niaj hnub no? Tam sim no layout yog siv CCS3 cov ntxhuav, nrog rau cov lus tshwj xeeb HTML5.

Vim li cas koj thiaj xav tau lub vev xaib teb

  • Koj tuaj yeem nkag mus rau lub vev xaib siv gadgets nrog cov kev daws teeb meem sib txawv. Niaj hnub no, tib neeg siv ntau yam khoom siv sib txawv rau kev xav tau hauv tsev thiab siv Internet. Tau kawg, ib qho thiab tib lub xaib yuav tsum tau muab tso tawm kom pom zoo thiab saib zoo ntawm cov khoom siv nrog qhov sib txawv thiab qhov kev daws teeb meem. Cov neeg siv yuav tsum tsis txhob ntxhov siab thaum ua haujlwm nrog ib qho khoom siv tshwj xeeb.
  • nce hauv Is Taws Nem kev khiav tsheb, kev nyiam ntawm cov ntawv thov mobile thiab cov khoom siv. Qhov kev thov tam sim no rau cov khoom siv hluav taws xob uas koj tuaj yeem nkag mus rau hauv lub network yog qhov tsim nyog thiab tsis tshua muaj leej twg yuav sib cav nrog qhov tseeb. Xws li qhov chaw tsuas yog tsis tuaj yeem tsis quav ntsej, vim tias cov neeg siv no tej zaum sawv cev rau tus tsov ntxhuav feem ntawm koj cov neeg tuaj saib tag nrho. Yog li, yog tias koj xav kom tus naj npawb ntawm cov neeg tuaj xyuas koj cov peev txheej zoo ib yam lossis nce nws, ces koj yuav tsum tau ua tib zoo saib xyuas lawv cov kev xav tau thiab kev txaus siab. Hauv lwm lo lus, koj yuav tsum ua qhov zoo tshaj plaws los ua kom koj qhov chaw ua haujlwm tau yooj yim li sai tau, txwv tsis pub koj cov neeg siv khoom tsuas yog mus rau koj cov neeg sib tw.
Yuav ua li cas ua kom teb lub vev xaib layout
Yuav ua li cas ua kom teb lub vev xaib layout

xov xwm ceev. Yog tias koj qhov tshwj xeeb yog muab cov xov xwm thiab lwm cov ntaub ntawv tawg, ces tau kawg, tus neeg siv yuav xav tau nws sai, thiabTej zaum nws yuav tsis muaj dab tsi tab sis ib lub xov tooj ntawm tes thaum lub sijhawm ntawd. Yog li koj txoj haujlwm yog los xyuas kom meej tias nws tuaj yeem tau txais cov ntaub ntawv tsim nyog sai li sai tau

Kev sib piv ntawm cov lus teb layout thiab mobile app

Txhua yam kev pab cuam thiab qhov chaw uas siv mobile versions rau lawv cov gadgets ntsig txog kuj yog ib qho kev txav mus los zoo, tab sis lawv muaj ntau qhov tsis zoo.

  • Ib daim ntawv thov mobile yuav tsum tau ua raws li hom kev ua haujlwm. Thiab rau qhov no koj yuav tsum siv sijhawm tsis yog xwb, tab sis kuj nyiaj.
  • Kev yuav tsum tau rub tawm. Txhawm rau siv daim ntawv thov, tau kawg, nws yuav tsum tau teeb tsa. Tau kawg, tus neeg siv tuaj yeem ua qhov no, tab sis tsuas yog nyob ntawm qhov xwm txheej uas nws xav tau ntau zaus. Yog tias nws tsis muaj qhov xav tau, feem ntau nws yuav tsis kam lees qhov kev lees paub no. Yog li ntawd, koj yuav poob ib feem tseem ceeb ntawm koj cov neeg tuaj saib.
Qhov sib txawv ntawm lub vev xaib teb thiab cov apps
Qhov sib txawv ntawm lub vev xaib teb thiab cov apps

Vim li cas koj thiaj li yuav tsum tawm apps

  • Kev faib tawm. Kev siv daim ntawv thov tsis qhia txog qib kev tuaj koom ntawm cov peev txheej. Hauv lwm lo lus, kev khiav ntawm qhov kev zov me nyuam thiab lub xaib tsis suav nrog, uas ua rau txo qis ntawm qhov ntsuas koj txaus siab.
  • Kev sib koom ua ke ntawm cov khoom siv. Yog tias koj tau txais daim ntawv thov, ces koj yuav tau siv nyiaj ntxiv los synchronize tag nrho cov ntaub ntawv, lossis, sau lub xaib, kuj hloov cov ntsiab lus mus rau qhov program. Vim li ntawd, koj rov poob koj cov nyiaj thiab sijhawm.

Yuav ua li cas hloovlub website design

Thawj kauj ruam yog tsim txhua txoj haujlwm. Nyob rau hauv tus txheej txheem, tus tsim qauv yuav tsum txawj tshaj tawm cov ntsiab lus thiab cov tswv yim tseem ceeb uas siv cov zaub me me thiab tsuas yog ib kab ntawv qhia xwb.

Yog tias tsim nyog, cov ntaub ntawv thaiv raug txo qis, tsuas yog cov ntsiab lus tseem ceeb tshaj plaws. Cov lus qhia pib pib feem ntau suav nrog:

  • mobile thawj - tsim rau cov khoom siv hluav taws xob;
  • cov duab hloov tau - siv cov duab hloov tau;
  • daim phiaj-raws li layout - siv cov kab sib chaws yooj yim-raws li layouts;
  • media queries - ua cov lus nug xov xwm.
Yuav ua li cas los tsim lub vev xaib teb
Yuav ua li cas los tsim lub vev xaib teb

Yuav ua li cas kom lub vev xaib teb? Ua li no, koj tuaj yeem siv ntau hom layouts.

  • Rubber. Hom no yog ib qho yooj yim rau kev siv, nws tsis tshua muaj teeb meem txawm rau beginners. Lub ntsiab blocks ntawm cov peev txheej yog compressed kom txog thaum lawv haum rau qhov loj ntawm cov ntxaij vab tshaus mobile. Yog tias compression tsis tuaj yeem, ces lawv muab tso rau hauv daim kab xev.
  • Txhob thaiv. Cov txheej txheem no ua haujlwm zoo kawg nkaus rau cov peev txheej nrog ntau kab. Qhov kev tso kawm ntawm cov blocks ntxiv txawv raws li qhov ntev ntawm qhov screen. Yog hais tias cov zaub shrinks, cov sidebars txav mus rau hauv qab.
  • Hloov layouts. Qhov no yog cov txheej txheem siv sijhawm ntau, uas suav nrog kev siv cov qauv tsim tshwj xeeb rau txhua qhov kev daws teeb meem. Txoj kev no ua rau kev kawm zoo heev ntawm qhov chaw, tab sis qhov nyuaj ntawm kev ua haujlwm ua rau nws tsis lees paub.
  • Elementary layout. Methodology, impeccablehaum rau cov peev txheej yooj yim. Tus tsim qauv tsuas ntsuas cov duab thiab cov ntawv sau. Txawm hais tias txoj kev no tsis tuaj yeem hu rau hauv kev thov vim tsis muaj qhov hloov pauv.
  • Panels. Cov txheej txheem no yog los ntawm cov ntawv thov mobile, uas cov ntawv qhia pabcuam tuaj yeem tshwm sim ntawm txhua txoj haujlwm ntawm cov zaub. Tam sim no txoj kev no kuj tsis nrov heev, txij li kev siv xov tooj ntawm tes ntawm lub xaib tsis yog ib txwm meej rau cov neeg siv.

Tsis muaj ib qho ntawm cov txheej txheem piav qhia tuaj yeem hu ua universal. Yuav ua li cas thiaj ua tau lub vev xaib teb? Ua ntej tshaj plaws, koj yuav tsum xaiv qhov tsim nyog, nyob ntawm qhov project. Nws yuav tsum ua raws li cov peev txheej ntawm cov peev txheej thiab ua tiav txhua qhov kev xav tau.

Yuav ua li cas thiaj teb lub vev xaib layout

Hnub no, CSS3 thiab HTML5 tau siv rau qhov no. Thawj thev naus laus zis yog ib tiam dhau los ntawm cov ntxhuav cascading. Nrog nws cov kev pab, cov kev cai raug tsim raws li cov ntsiab lus ntawm lub xaib yuav raug tso tawm ntawm tus neeg siv cov zaub.

Nrog kev pab ntawm CSS3, koj tuaj yeem teeb tsa ntau qhov tsis sib xws: feem pua ntawm qhov chaw nyob thiab qhov ntev ntawm lub caij ntawm ib qho kev daws teeb meem. Nrog rau cov thev naus laus zis no, cov neeg tsim qauv tuaj yeem tsim cov chav sib txawv uas haum rau qee yam ntxwv.

HTML5 yog siv los qhia qhov chaw ntawm qee cov ntsiab lus, hauv lwm lo lus, txhawm rau kos rau nplooj ntawv. Cov chav kawm CSS3 generated tau teev nyob rau hauv HTML cim npe kom cov khoom siv tuaj yeem hloov kho nyob ntawm qhov kev daws teeb meem.

Yog li, yuav ua li cas thiaj tsim lub vev xaib teb nrog html? Koj yuav tsum pib los ntawm kev tsim cov duab yooj yim uasces ncab.

Qhov no tsim cov duab ua lub plhaub.

Yuav ua li cas kom lub vev xaib teb nrog CSS? Teem cov kev txwv hauv qab no:

div {

dav: 100%;

}

div img {

dav: 100%;

siab: auto;

}

Tom qab ntawd, los ntawm qhov dav ntawm div, teeb tsa qhov dav ntawm daim duab img.

Yog li koj tau txais cov duab uas yuav siv tag nrho qhov chaw tso saib ntawm txhua qhov kev daws teeb meem.

Cov theem ntawm kev tsim qhov chaw hloov kho
Cov theem ntawm kev tsim qhov chaw hloov kho

kho tus kheej cov khoom

Site header. Muab ob peb lub ntsiab lus hauv header:

logo -

nkaum kab ntawv khawm -

main menu -

site search -

  • Thaiv nrog cov ntawv nyeem. Siv lub ntsiab los qhwv kab lus.
  • Sib kab. Siv los nrhiav cov npe qeb, nyem rau cov npe xa ntawv thiab cov ntawv tshaj tawm tshiab.
  • Yuav ua li cas hloov cov ntawv qhia zaub mov rau lub vev xaib? Ntxiv ib lub ntsiab rau lub cim. Cov cai no hloov qhov siab ntawm cov ntawv qhia zaub mov, haum cov ntsiab lus rau qhov yuav tsum tau muaj qhov ntev.

Creating a mini-gallery

Kev paub yuav ua li cas thiaj li teb tau html thiab css lub vev xaib, koj tuaj yeem sau koj cov peev txheej nrog cov ntsiab lus tseem ceeb thiab nthuav dav tsim nyog rau txhua yam khoom siv, piv txwv li, mini-gallery.

Txhawm rau ntxiv ntau cov duab rau HTML, siv cov ntsiab lus hauv qab no:

Thiab kom txhua daim duab cuam tshuam nrog cov kev daws teeb meem sib txawv thiab hloov nws qhov loj me, siv CSS3:

div.image_gallery {

margin: 0 auto;

dav: 1000px;

min-dav: 500px;

}

img {

max-dav: 48%;

padding: 1%; / me ntsis padding rau cov duab /

}

Nov yog nws, koj lub chaw ua yeeb yam mini tau npaj txhij. Tam sim no koj paub yuav ua li cas ua kom koj lub vev xaib teb rau cov khoom siv sib txawv.

Yuav ua li cas los tsim lub teb lub website tsim
Yuav ua li cas los tsim lub teb lub website tsim

Yuav ua li cas txhawm rau ua haujlwm zoo

  • Google Chrome. Ib zaug hauv qhov browser, nias F12. Tom qab ntawd, lub vaj huam sib luag yuav qhib - nyem rau ntawm lub cim ntawm lub cuab yeej koj nyiam, piv txwv li, ntsiav tshuaj lossis smartphone. Thiab los ntawm cov ntawv qhia zaub mov tom ntej, xaiv qhov kev daws teeb meem xav tau.
  • Deviceponsive. Ib qho kev pab cuam uas koj tuaj yeem tshawb xyuas qhov kev hloov kho los ntawm kev thauj khoom ntawm qhov chaw los ntawm IFrame. Nyob ntawd koj yuav pom cov npe ntawm cov khoom siv nrog cov kev daws teeb meem sib txawv.
  • Aresponsivedesign.is. Nov yog qhov chaw lom zem. Ua ntej, lub xaib tau thauj mus rau IFrame windows, thiab tom qab ntawd hloov mus rau Apple cov ntxaij vab tshaus. Qhov no ua rau nws yooj yim heev rau kev thaij duab thaij duab.

Pom zoo: