Cov txheej txheem:

Lub thawv Flexbox yog dab tsi?
Lub thawv Flexbox yog dab tsi?

Video: Lub thawv Flexbox yog dab tsi?

Video: Lub thawv Flexbox yog dab tsi?
Video: PSD to HTML using Bootstrap 4 (Part 2) - Bootstrap Slider or Carousel 2024, Kaum ib hlis
Anonim

A flex thawv nthuav cov khoom kom sau qhov chaw dawb los yog shrinks lawv kom tsis txhob dhau. Qhov tseem ceeb tshaj, cov flexbox ua layout yog kev taw qhia-agnostic as opposed to the li niaj zaus layouts (block uas yog vertically-based thiab inline uas yog kab rov tav-raws li).

Txog qhov no, koj siv Flexbox li cas?

Cov ntsiab lus

  1. Siv cov zaub: flex; los tsim ib lub thawv flex.
  2. Siv justify-cov ntsiab lus los txhais cov kab rov tav sib dhos ntawm cov khoom.
  3. Siv cov khoom sib dhos los txhais cov kab ntsug ntsug ntawm cov khoom.
  4. Siv flex-direction yog tias koj xav tau kab es tsis txhob kab.
  5. Siv cov kab rov qab lossis kab rov qab qhov tseem ceeb los hloov cov khoom xaj.

Yuav ua li cas koj ua ib lub thawv Flex? Ua ntej koj yuav siv tau ib yam flexbox ua khoom, koj yuav tsum tau txhais a flex thawv hauv koj qhov layout. Koj tsim lub thawv flex los ntawm kev teeb tsa cov khoom vaj khoom tsev ntawm ib lub caij rau ib qho ntawm flexbox ua tus nqi layout: ua flex los yog inline- ua flex . Los ntawm lub neej ntawd, ua flex cov khoom yog nteg tawm horizontally ntawm lub ntsiab axis ntawm sab laug mus rau sab xis.

Hauv qhov no, Flexbox siv rau dab tsi?

Flexbox yog tus qauv layout uas tso cai rau cov ntsiab lus sib dhos thiab faib qhov chaw hauv ib lub thawv. Siv qhov dav dav thiab qhov siab, cov ntsiab lus tuaj yeem ua raws li qhov chaw los yog faib qhov chaw ntawm cov khoom, uas ua rau nws yog ib qho cuab yeej zoo rau siv rau teb tsim systems.

Dab tsi yog qhov default orientation nyob rau hauv lub thawv Flex?

Cov ua ntej kev npaj tom qab siv cov zaub: ua flex yog rau cov khoom yuav tsum tau teem raws lub ntsiab axis ntawm sab laug mus rau sab xis. Cov animation hauv qab no qhia tias yuav ua li cas thaum twg ua flex - kev taw qhia : kab yog ntxiv rau lub thawv keeb. Koj tuaj yeem ua tau teem flex - kev taw qhia mus rau kab-rov qab thiab kab-rov qab.

Pom zoo: