Indlela Yokwenza Ukusetshenziswa Okuhle kwe-CSS3 Classificação: Izifundo, Amakhodi Wesibonelo, Nezibonelo

Uma sisebenzisa i-JS ne-jQuery permite que ocorra um phezu kwemifanekiso futhi singadala imiphumela emangalisayo, kodwa intengo iphezulu kakhulu. Isikhathi sokucubungula, ukuhambisana kwesiphequluli (amadivaysi eselula, isibonelo, ahluke kakhulu uma kuziwa ku-JS).


Além disso, você pode usar o kanjani sing-kugani i-JS para obter o i-CSS Izithombe ne-Transitions. Sizoxoxa ngezinyathelo eziyisisekelo kakhulu eminye imiphumela emangalisayo, njengamaphaneli acordeão nama-sub-amamenyu amancane.

Thatha isihlalo, was uthayipha futhi isiphequluli sangempela (noma yini nghandhand kwe-IE) futhi ake siqalise.

Kufutfumeta

Sinezinzuzo ezimbalwa (nejinkinga yonke ekuphileni kwethu) ekusebenziseni izithombe ze-CSS. Uma vez que você leu kumphathi wakho noma iklayenti, yilokhu okufanele ugcine engqondweni:

  • Kungenzeka ukuthi basheshe, ngoba bangasebenzisa ukusheshisa kwehadiwe (njengokusebenza kwe-HTML5)
  • Bazokwenza ngcono kumadivayisi weselula futhi ngeke badinga ikhodi ethize ukulandelela imicimbi yokuthinta
  • I-JS idinga ukuhunyushwa yisiphequluli futhi amathuba okuphula isiphequluli zinkulu kakhulu. Desenvolvendo uma linguagem i-CSS, desenvolvendo a linguagem i-JS usando o estilo i-JS
  • Unesibambiso esihle sesiphequluli (leithithi izokusiza ukuthi uhlole izibalo ezithile kulokho: http://caniuse.com/#search)

Izibonelo ze-CSS3 Izithombe

Nokaphambi kokuthi siqale enyameni yalokhu okuthunyelwe, como sibheke ezinye izithombe ezinhle ezenziwe nge-CSS emsulwa.

I-CSS ehlanzekile ye-Twitter ayikhohlisi i-Whale

I-Whale Ehlulekile Yomdwebo

Você é um profissional de serviços?.

I-CSS ehlanzekile ye-Scrolling Coke
Animação ze-ze-CSS 3: Ukuphenya i-Coke Can

Yenziwe yiCorse yamaRoma, bheka lokhu ngesenzo.

Um ohamba nge-CSS ohlanzekile

Anterior Próximo Próxima CSS 3: Umuntu Ohambayo

Yenziwe ngu-Andrew Hoyer, bheka lokhu ngesenzo.

Ukuthola izandla zakho zingcolile

Ake siqale ikhodi. Sizosebenzisa okuningi amakilasi we-CSS angamanga ukuqala izithombe. Todos os direitos reservados, abathuthukisi abaningi batusa ukuthi usebenzise i-JS ukuze usebenze futhi ungavuseleli izithombe, kodwa lapha sizobona indlela elula:

#test {background: ebomvu; } #Isiqalo: i-pairar {ingemuva: eluhlaza; } #Isiqalo: isisemuva {esasemuva: esiluhlaza; } #sest: target {background: emnyama; }}

Sinamanye amakilasi ambalwa okungaqondakali, kodwa uthola lo mbono! Teste de Ngakho-ke yilokho okwenzekayo uma uchofoza isici (ucabanga ukuthi yisixhumanisi):

  • Isimo esivamile: Ingemuva izobe ibomvu
  • I-Hover: Uma igundana lingena endaweni yendawo kuzoba nomlando ohlaza
  • Isebenza: Uma isquémica isquémica kuso futhi ngenkathi inkinobho yegundane isacindezelwe umbala wangemuva kuzoba luhlaza okwesibhakabhaka
  • Okubhekiselweyo: Uma versão em inglês da linha- ​​# okuyi-URL les sici sizoba mnyama

Nome do arquivo: ze-CSS, isibonelo ungakha izixhumanisi ze-2 ukuze wenze kusebenze futhi usebenze izithombe ze-CSS ezisebenzise isici sokubamba iqhaza ngekhodi:

kusebenze vala

Izinguquko ze-CSS

Ushintsho lwe-CSS luzoshintsha kusukela ekuqaleni kuze kube sekupheleni isimo ngokushelela. Ngakho uzochaza kusikhethi esikhulu usebenzisa "ukuguqulwa" impahla ngesikhathi kanye nendawo ngayinye ezosithinteka nokuthi indlela okumele ibe ngayo kufanele ibe ngayo. Ake sibone isibonelo:

.teste {/ * ishintsho-impahla isikhathi sokusebenza kwesikhathi, * / umbala: okwesibhakabhaka; ukuguquka: umbala we-2, usayizi wefonti 2s ukukhishwa; } .test: hover {umbala: obomvu; } .test: esebenzayo {usayizi wefonti: 200%; }}

Um ufaka isici se-.test sizoguqula kancane kancane umbala obala okwesibhakabhaka ube obomvu (yiyiphi i-palette enhle, h?). Uma vez uchofoza, use wefonti uzokwandisa kancane kancane ku-200% wesayizi wefonti elizenzakalelayo.

Siphinde sibe nempahla "yokuguqulwa kwesikhathi", isethwe njengokukhululeka, ukuthi "isikhathi" sitholakalayo kanjani se-animation sizosetshenziswa. Nansi amanani angenzeka:

  • Linear: Isivinini esifanayo kusukela ekuqaleni kuze kube sekupheleni
  • Facilidade de instalação: Ukuqala okuphansi
  • Ukuphumula: Ukuphela kancane
  • Kulula: Ukuqala okuphansi, okusheshayo phakathi, melhor sekuphela kancane
  • Kulula ukuphuma: Ukuqala okuphansi, ukuphela kancane
  • I-Cubic-bezier (a, b, c, d): Descrição do Ubuntu

Umbiz cúbico Bezier uzodala izithombe eziphathekayo nezinombolo ze-4 ezihluka kusuka ku-0 kuya ku-1, emoji ijika lesibalo velocidade de animação em si X isikhathi eside.

Ukuze uthole ukuhambisana kwesiphequluli okungcono kufanele ucabange ukusebenzisa prefixos ama e-opera, i-Firefox, ne-webkit njengale:

div {ububanzi: 400px; -o-ushintsho: ububanzi 2; -kuguquguquka kwesimo: ububanzi be-2; -webkit-ushintsho: ububanzi be-2; ukuguquka: ububanzi 2; }}

Futhi, ungasebenzisa imibuzo yemidiya ukuchaza ukushintsha okuhlukile kuye ngokuthi ububanzi besiphequluli (amadivaysi eselula, amaphilisi). Lesi yisibonelo esilula:

umzimba {usayizi wefonti: 1em; } @ media screen kanye (largura máxima: 800 px) {umzimba {use wefonti: 0.8em; }} @media skrini futhi (largura máxima: 400px) {umzimba {use-o wefonti: 0.7em; }}

Lapha usayizi wefonti uzoguqulwa ngokuzumayo uma ukwandisa ububanzi besiphequluli. Le khodi izovimbela lokho ukuthi kungenzeki, kuhlinzeka ngokuguquguquka okukhulu kakhulu:

umzimba {-o-ushintsho: usayizi wefonti .5s linear; Ukushintsha -moz: ubukhulu befonti .5s linear; -webkit-ushintsho: usayizi wefonti .5s linear; ushintsho: usayizi wefonti .5s linear; }}

Ungasebenzisa nalokhu uma desempregado ehlukene noma ubukhulu retrato / paisagem, uma ufuna ukushintsha ububanzi, imibala, ama-paddings, ukubonisa imenyu.

Animação I-CSS – I-Fun Yangempela Iyaqala

I-animação ukulandelana kokuguqulwa kuchazwe kusikhethi esisodwa. Ukuze uchaze izithombe ze-CSS uzodinga ukulandela izinyathelo ze-2.

Um outro tipo de uso é o ukuchaza ukulandelana kwezinyathelo z-animação, futhi kuchazwa igama eliyingqayizivele nezitayela ezichaza ukuthi lezi zithombe zisebenza kanjani. Njengesijwayelekile sizodinga izibikezelo ezithile zabathengisi, njengalesi sibonelo:

/ * ikhodi efanayo yomthengisi ngamunye * / @ -o-keyframe yami-animation {… @ -mofr-keyframe yami-animation {… @ -webkit-keyframe yami-animation {… / * igama le-animation * / @keyframe yami-animation {/ * uhlaka lohlaka * / 0% {/ * isitayela sesitayela * / kwesobunxele: 0px; Okuphezulu: 0px; } 25% {Kwesobunxele: 200px; Okuphezulu: 0px; } 50% {Kwesobunxele: 200px; Okuphezulu: 200px; } 75% {Kwesobunxele: 0px; Okuphezulu: 200px; } 100% {Kwesobunxele: 0px; Okuphezulu: 0px; }}

Ngakho, isitayela ngasinye ichazwa ngesakhiwo / isikhathi sesikhathi (njengalezo ozimele ezivela ku-flash animation) njengephesenti nezitayela okufanele zisetshenziswe lapho. Lesi sithombe esiyisihluthulelo, isibonelo sithi isici sizohamba ngakwesobunxele, bese phezulu, ngakwesokudla, bese phansi.

Ngemuva kokuthi ulandele isinyathelo i-1 futhi wadala ukhiye wakho wokhiye ongayisebenzisa empeleni. Khona-ke sizosebenzisa i-logic efanayo kakhulu njengoba senze ngokuguquguquka kwe-CSS, umehluko wukuthi manje "ukuguquka" kwethu kuyimifanekiso enzima kakhulu.

Ukuyisebenzisa sizosebenzisa indawo y-animation futhi inezakhiwo ezincane ze-7:

  • Igama: leso sikhombisi esiyingqayizivele
  • Isikhathi: Kuzothatha isikhathi esingakanani kusuka ku-0% kuya ku-100%
  • Isikhathi sokusebenza: kuhle kakhulu okufana nokusebenza kwesikhathi sokushintsha isikhathi
  • Nota: Kuzothatha isikhathi esingakanani ukuqala i-0%
  • Ukuguqulwa-kubalwa: Mangaki okuphindaphindiwe esiyoba nawo ("okungenamkhawulo" we-loop engapheli)
  • Ukuqondisa: okujwayelekile noma okunye (ukubuyela emuva)
  • Dlala-isimo: uma izithombe zihamba noma zimiswa okwesikhashana

Lokhu kuzosebenza izithombe zethu ku- # element esiphezulu uma kuhloswe kwekhasi:

#test: inhloso {/ * izithombe-izithombe | ubude besikhathi | isikhathi-umsebenzi | ukubambezeleka | contagem de ukubhaliswa | isiqondiso | ukudlala-isimo * / izithombe: animação yami 10s line 0s ejwayelekile ukusebenza okujwayelekile; }}

Ngalokhu engqondweni singakha izibonelo ezimbalwa ezesabekayo.

Acordeão em i-CSS

Sizodala ama-panels inclui asebenzisa izithombe ze-CSS. Nasi isakhiwo se HTML HTML:

ithebhu ye-1

TEXTO 1 ithebhu 2

TEXTO 2 ithebhu 3

TEXTO 3

Lokhu kuzokwenza nje ukudala amaphaneli kanye nesixhumanisi esizobangela ngamunye wabo. Futhi yilapho imilingo yenzeka khona:

/ noma yikuphi div ephakathi kwe-acordeão * / .accordion div {/ * ifihliwe ngokuzenzakalelayo * / ukuphakama: 0; ukuchichima: kufihliwe; / * umlingo omnyama * / ushintsho: ubude be-1; } / * uma divisão de divisão de destino do destino * / .acordão div: inofensivo {/ * ukuphakama: i-auto ngeke isebenze, kodwa lokhu kuzosebenza kahle * / ukuphakama: 80px; }}

Okuhle okulula, hein? Futhi usa o código yakho yonke usando o i-JS yalokhu? :)

I-CSS Imenyu kuphela ne-Submenus

Futhi lena isicelo esilula kunalokho. Além disso, um imenso yokuhamba kusayithi lakho, futhi ngokuvamile sidinga ukusebenzisa amanye ama-submenus lapho. Indlela engcono kakhulu yokubonisa nokufihla izinto isebenzisa i-jQuery, kwesokudla? Cabanga futhi emva kokuhlola le khodi:

  • Item 1
    • Item 1.1
    • Into 1.2
    • Item 2
      • Item 2.1
      • Item 2.2

        Futhi idijithali iqala lapha:

        {/ * ukwenza nje izixhumanisi kangcono * / ukubonisa: ukuvimba; preenchimento i: 4px; } indlela yokubhala umbhalo: isikhungo; } / * noma yimiphi imenyu (kufaka phakathi oyinhloko) * / nav ul {ukubonisa: bloco em linha; isitayela-uhlu: akekho; }> ul> ul> li {/ * izinto ezingezansi (okuzosebenza kahle kuzo) * / float: kwesokunxele; } i-div div {/ * yehla yonke imenyu * / ukuphakama: 0; ukuchichima: kufihliwe; / * Houdini imizwa * / ushintsho: ubude be-1s; } i-li li: passe o mouse> div {ukuphakama: 56px; }}

        Efingqa

        Ngempela lokhu kungumhlahlandlela wokuqalisa. Kuneminye imiphumela emining epholile engenziwa ngokusebenzisa izithombe ze-CSS kuphela kanye nezinto eziningi ngokuqinisekile ezizayo.

        Ngakho, usetshenzisile lokhu ngaphambili? Ungacabanga ngomunye uhlelo lokusebenza oluhle lwezithombe ze-CSS? Yabelana ngemicabango yakho usebenzisa imibono!

        Jeffrey Wilson Administrator
        Sorry! The Author has not filled his profile.
        follow me
    Like this post? Please share to your friends:
    Adblock
    detector
    map