Kuv yuav ntxiv ib qho navigation bar hauv bootstrap li cas?
Kuv yuav ntxiv ib qho navigation bar hauv bootstrap li cas?

Video: Kuv yuav ntxiv ib qho navigation bar hauv bootstrap li cas?

Video: Kuv yuav ntxiv ib qho navigation bar hauv bootstrap li cas?
Video: 6 Nqi Lus Qhia Kev Ua neej ( leej twg mloog lub neej yuav zoo tuaj) 2024, Kaum ib hlis
Anonim

Rau tsim ib collapsible navigation bar , siv lub pob nrog class=" navbar -toggler", data-toggle="collapse" thiab data-target="#thetarget". navbar cov ntsiab lus (kev sib txuas, thiab lwm yam) hauv ib lub ntsiab lus div nrog class="collapse navbar -collapse", ua raws li tus id uas phim cov ntaub ntawv-lub hom phiaj ntawm lub pob: "thetarget".

Yog li ntawd, qhov bar navigation nyob qhov twg?

Ib lub vev xaib navigation bar feem ntau tshwm sim raws li kab rov tav daim ntawv txuas rau saum toj ntawm txhua nplooj ntawv. Tej zaum nws yuav nyob hauv qab lub taub hau lossis lub logo, tab sis nws ib txwm muab tso ua ntej cov ntsiab lus tseem ceeb ntawm nplooj ntawv. Qee zaum, nws yuav ua rau muaj kev nkag siab rau qhov chaw navigation bar vertically nyob rau sab laug ntawm txhua nplooj ntawv.

Ib sab saum toj, vim li cas kuv yuav tsum siv bootstrap? Bootstrap yog qhov kev xaiv zoo rau kev ua lub vev xaib teb. Nrog rau cov kab sib chaws dej zoo thiab cov chav kawm siv hluav taws xob ua haujlwm tsim lub vev xaib teb yog txoj haujlwm du thiab yooj yim. Tam sim no Bootstrap yog mobile ua ntej.

Kuj nug, kuv yuav ua li cas thiaj dhau Bootstrap styles?

Txoj kev zoo tshaj plaws thiab yooj yim ntawm overriding bootstrap lossis lwm yam css yog kom paub tseeb tias koj cov ntaub ntawv css suav nrog tom qab lub bootstrap css cov ntaub ntawv hauv header. Tam sim no yog tias koj xav tau override ib chav kawm tshwj xeeb ces cia li luam cov css ntawm koj bootstrap css cov ntaub ntawv thiab muab tshuaj txhuam rau hauv koj cov ntaub ntawv css ces ua qhov kev hloov pauv.

Kuv yuav teeb tsa bootstrap li cas?

  1. Kauj ruam 1: Teeb thiab saib xyuas. Tsim ib nplooj ntawv HTML. Load Bootstrap ntawm CDN lossis tuav nws hauv zos. suav nrog jQuery. Load Bootstrap JavaScript. Muab tag nrho ua ke.
  2. Kauj Ruam 2: Tsim koj nplooj ntawv tsaws. Ntxiv ib tug navigation bar. suav nrog CSS kev cai. Tsim ib nplooj ntawv ntim ntim. Ntxiv cov duab tom qab thiab kev cai JavaScript. Ntxiv ib qho Overlay.

Pom zoo: