Hloov mus rau v3.x
Kev taw qhia txog yuav ua li cas hloov kho los ntawm Bootstrap v2.x rau v3.x nrog rau qhov tseem ceeb ntawm kev hloov pauv loj, dab tsi tshiab, thiab dab tsi tau raug tshem tawm.
Kev taw qhia txog yuav ua li cas hloov kho los ntawm Bootstrap v2.x rau v3.x nrog rau qhov tseem ceeb ntawm kev hloov pauv loj, dab tsi tshiab, thiab dab tsi tau raug tshem tawm.
Bootstrap 3 tsis rov qab tau tshaj v2.x. Siv ntu no ua cov lus qhia dav dav rau kev hloov kho dua tshiab ntawm v2.x rau v3.0. Rau kev nthuav dav dav, saib dab tsi tshiab hauv v3.0 tshaj tawm tshaj tawm.
Cov lus no qhia cov kev hloov pauv ntawm v2.x thiab v3.0.
Bootstrap 2.x | Bootstrap 3.0 |
---|---|
.row-fluid |
.row |
.span* |
.col-md-* |
.offset* |
.col-md-offset-* |
.brand |
.navbar-brand |
.navbar .nav |
.navbar-nav |
.nav-collapse |
.navbar-collapse |
.nav-toggle |
.navbar-toggle |
.btn-navbar |
.navbar-btn |
.hero-unit |
.jumbotron |
.icon-* |
.glyphicon .glyphicon-* |
.btn |
.btn .btn-default |
.btn-mini |
.btn-xs |
.btn-small |
.btn-sm |
.btn-large |
.btn-lg |
.alert |
.alert .alert-warning |
.alert-error |
.alert-danger |
.visible-phone |
.visible-xs |
.visible-tablet |
.visible-sm |
.visible-desktop |
Faib rau hauv.visible-md .visible-lg |
.hidden-phone |
.hidden-xs |
.hidden-tablet |
.hidden-sm |
.hidden-desktop |
Faib rau hauv.hidden-md .hidden-lg |
.input-block-level |
.form-control |
.control-group |
.form-group |
.control-group.warning .control-group.error .control-group.success |
.form-group.has-* |
.checkbox.inline .radio.inline |
.checkbox-inline .radio-inline |
.input-prepend .input-append |
.input-group |
.add-on |
.input-group-addon |
.img-polaroid |
.img-thumbnail |
ul.unstyled |
.list-unstyled |
ul.inline |
.list-inline |
.muted |
.text-muted |
.label |
.label .label-default |
.label-important |
.label-danger |
.text-error |
.text-danger |
.table .error |
.table .danger |
.bar |
.progress-bar |
.bar-* |
.progress-bar-* |
.accordion |
.panel-group |
.accordion-group |
.panel .panel-default |
.accordion-heading |
.panel-heading |
.accordion-body |
.panel-collapse |
.accordion-inner |
.panel-body |
Peb tau ntxiv cov ntsiab lus tshiab thiab hloov qee qhov uas twb muaj lawm. Nov yog cov qauv tshiab lossis hloov kho tshiab.
Element | Kev piav qhia |
---|---|
Vaj huam sib luag | .panel .panel-default .panel-body .panel-title .panel-heading .panel-footer .panel-collapse |
Sau pawg | .list-group .list-group-item .list-group-item-text .list-group-item-heading |
Glyphicons | .glyphicon |
Jumbotron | .jumbotron |
Daim phiaj me me ntxiv (<768px) | .col-xs-* |
Daim phiaj me me (≥768px) | .col-sm-* |
Daim phiaj nruab nrab (≥992px) | .col-md-* |
Daim phiaj loj (≥1200px) | .col-lg-* |
Responsive Utility Classes (≥1200px) | .visible-lg .hidden-lg |
Offsets | .col-sm-offset-* .col-md-offset-* .col-lg-offset-* |
Nias | .col-sm-push-* .col-md-push-* .col-lg-push-* |
Rub | .col-sm-pull-* .col-md-pull-* .col-lg-pull-* |
Input qhov siab qhov ntau thiab tsawg | .input-sm .input-lg |
Input pab pawg | .input-group .input-group-addon .input-group-btn |
Daim ntawv tswj | .form-control .form-group |
khawm pawg qhov ntau thiab tsawg | .btn-group-xs .btn-group-sm .btn-group-lg |
Navbar ntawv nyeem | .navbar-text |
Navbar header | .navbar-header |
Justified tabs / ntsiav tshuaj | .nav-justified |
Teb cov duab | .img-responsive |
Contextual kab kab | .success .danger .warning .active .info |
Cov ntsiab lus vaj huam sib luag | .panel-success .panel-danger .panel-warning .panel-info |
Modal | .modal-dialog .modal-content |
duab thumbnail | .img-thumbnail |
Zoo qhov ntau thiab tsawg | .well-sm .well-lg |
ceeb toom links | .alert-link |
Cov ntsiab lus hauv qab no tau poob lossis hloov pauv hauv v3.0.
Element | Tshem tawm ntawm 2.x | 3.0 Sib npaug |
---|---|---|
Tsim cov yeeb yam | .form-actions |
N/A |
Nrhiav daim ntawv | .form-search |
N/A |
Tsim pab pawg nrog cov ntaub ntawv | .control-group.info |
N/A |
Tsau-dav input qhov ntau thiab tsawg | .input-mini .input-small .input-medium .input-large .input-xlarge .input-xxlarge |
Siv .form-control thiab daim phiaj system xwb. |
Thaiv qib daim ntawv nkag | .input-block-level |
Tsis muaj qhov sib npaug ncaj qha, tab sis cov ntaub ntawv tswj tau zoo sib xws. |
Inverse nyees khawm | .btn-inverse |
N/A |
Kua kab | .row-fluid |
.row (tsis muaj kab sib txuas ntxiv) |
Tswj wrapper | .controls |
N/A |
Tswj kab | .controls-row |
.row los yog.form-group |
Navbar sab hauv | .navbar-inner |
N/A |
Navbar ntsug dividers | .navbar .divider-vertical |
N/A |
Dropdown submenu | .dropdown-submenu |
N/A |
Tab alignments | .tabs-left .tabs-right .tabs-below |
N/A |
Pill-based tabbable cheeb tsam | .pill-content |
.tab-content |
Pill-based tabbable cheeb tsam pane | .pill-pane |
.tab-pane |
Nav lis | .nav-list .nav-header |
Tsis muaj qhov sib npaug ncaj qha, tab sis cov npe pawg thiab .panel-group s zoo sib xws. |
Inline pab rau daim ntawv tswj | .help-inline |
Tsis muaj qhov sib npaug, tab sis .help-block zoo sib xws. |
Tsis yog-bar-theem kev kawm xim | .progress-info .progress-success .progress-warning .progress-danger |
Siv .progress-bar-* rau ntawm qhov .progress-bar hloov. |
Lwm qhov kev hloov pauv hauv v3.0 tsis tshwm sim tam sim ntawd. Cov chav kawm hauv paus, cov qauv tseem ceeb, thiab kev coj cwj pwm tau hloov kho kom yooj yim thiab peb txoj hauv kev mobile thawj zaug . Nov yog ib daim ntawv teev npe ib nrab:
.form-control
chav kawm ntawm lub caij rau style..form-control
chav kawm siv tam sim no 100% dav los ntawm lub neej ntawd. Qhwv inputs sab hauv <div class="col-*"></div>
los tswj cov tswv yim dav..badge
tsis muaj contextual (-success,-primary, etc..) classes..btn
yuav tsum tau siv .btn-default
kom tau "default" khawm..row
tam sim no yog kua..img-responsive
rau qhov dej <img>
loj..glyphicon
, tam sim no yog font raws li. Icons kuj xav tau lub hauv paus thiab icon chav kawm (xws li .glyphicon .glyphicon-asterisk
)..modal-header
, .modal-body
, thiab .modal-footer
ntu tam sim no tau muab qhwv rau hauv .modal-content
thiab .modal-dialog
rau kev ua kom zoo nkauj ntawm tes thiab coj cwj pwm. Tsis tas li ntawd, koj yuav tsum tsis txhob siv .hide
rau .modal
hauv koj qhov cim npe.remote
kev xaiv modal yog tam sim no txhaj rau hauv .modal-content
(los ntawm v3.0.0 rau v3.0.3, rau hauv .modal
) es tsis txhob mus rau hauv .modal-body
. Qhov no tso cai rau koj los kuj yooj yim sib txawv ntawm header thiab footer ntawm lub modal, tsis yog lub cev modal.data-toggle="buttons"
los data-toggle="buttons-checkbox"
yog data-toggle="buttons-radio"
hauv lawv cov cim.'show.bs.modal'
. Rau tabs siv "pom" 'shown.bs.tab'
, thiab lwm yam.Yog xav paub ntxiv txog kev hloov kho dua tshiab rau v3.0, thiab cov lej snippet los ntawm zej zog, saib Bootply .