in English

Inhmelhriattirna

Khawvela responsive, mobile-first site siamna atana framework lar ber Bootstrap hmangin tan la la, jsDelivr leh template starter page hmangin tan la rawh.

A bul tan nghal vat

I project-ah Bootstrap hi rang taka add duh em? jsDelivr hmang la, open source CDN a thlawna hman theih a ni. Package manager hmangin nge source files download a ngai em? Downloads page ah hian kal rawh .

CSS a ni

Kan CSS load turin stylesheet chu stylesheet dang zawng zawng hmain <link>i chhungah copy-paste rawh .<head>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">

JS chuan a ti a

Kan component tam tak hi a hnathawh theih nan JavaScript hman a ngai a ni. A bik takin, jQuery , Popper , leh kan JavaScript plugins te an mamawh a ni. jQuery-a slim build kan hmang a, mahse full version pawh a support bawk.

A hnuaia <script>s</body> zinga pakhat chu i page tawp lamah, closing tag hma lawkah dah la , a enable theih nan. jQuery hi a rawn lang hmasa tur a ni a, chutah chuan Popper a rawn lang leh tur a ni a, chutah chuan kan JavaScript plugins te hi a rawn lang leh tur a ni.

Telkhawm

Bootstrap JavaScript plugin zawng zawng hi kan bundle pahnih zinga pakhat nen telh vek tur a ni. Both bootstrap.bundle.jsleh kan tooltips leh popovers atan Popperbootstrap.bundle.min.js te pawh a tel a, mahse jQuery erawh a ni lo . jQuery dah hmasa la, chutah Bootstrap JavaScript bundle dah leh rawh. Bootstrap-a thil awmte hriat belh duh chuan kan contents section hi en la.

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>

Inthenhrang

Scripts solution hranpa hmanga kal i tum chuan Popper hi a rawn lang hmasa tur a ni (tooltips emaw popovers emaw i hman chuan), chutah chuan kan JavaScript plugins te hi a rawn lang leh tur a ni.

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+" crossorigin="anonymous"></script>

Component hrang hrangte

Eng component nge chiang taka jQuery, kan JavaScript, leh Popper mamawh? A hnuaia show components link ah hian click la. Page structure i hriat chian loh chuan entirnan page template atan chhiar chhunzawm zel ang che.

JavaScript mamawh component te chu entir rawh
  • Hnawhchhuah a nih theihna tur alerts
  • State toggling tur button leh checkbox/radio hnathawh dan tur
  • Slide behavior zawng zawng, control leh indicator zawng zawng tan carousel
  • Content hmuh theihna toggling atan collapse rawh
  • Display leh positioning atan dropdowns ( Popper pawh a ngai bawk )
  • Display, positioning, leh scroll awm dan tur modal te
  • Navbar hmangin kan Collapse plugin chu responsive behavior implement turin kan tizau a ni
  • Scroll awm dan leh navigation update te chu scrollspy hmangin
  • Tooltips leh popovers te chu display leh positioning atan ( Popper pawh a ngai bawk )

Starter template a ni

I page te chu design leh development standard thar ber ber nen set up tir ngei ang che. Chu chu HTML5 doctype hman a, responsive behavior dik tak neih theihna turin viewport meta tag dah tel tihna a ni. A zawng zawng kha han dah khawm la, i page te chu hetiang hian a awm tur a ni:

<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous">

    <title>Hello, world!</title>
  </head>
  <body>
    <h1>Hello, world!</h1>

    <!-- Optional JavaScript; choose one of the two! -->

    <!-- Option 1: jQuery and Bootstrap Bundle (includes Popper) -->
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script>

    <!-- Option 2: Separate Popper and Bootstrap JS -->
    <!--
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-+sLIOodYLS7CIrQpBjl+C7nPvqq+FbNUBDunl/OZv93DB7Ln/533i8e/mZXLi/P+" crossorigin="anonymous"></script>
    -->
  </body>
</html>

Chu chu overall page mamawhna atana i mamawh zawng zawng chu a ni. I site-a thu awmte leh a component-te lay out ṭan turin Layout docs emaw kan official entirnan emaw tlawh la .

Global pawimawh tak tak te

Bootstrap hian global style leh setting pawimawh tak tak a hmang a, chu chu i hman hunah i hriat chian a ngai dawn a, chung zawng zawng chu cross browser style normalization lam hawia siam vek a ni deuh ber. Dive lut ila.

HTML5 doctype a ni

Bootstrap hian HTML5 doctype hman a ngai a. A tel lo chuan funky incomplete styling thenkhat i hmu ang a, mahse a telh chuan hiccups lian tham a thlen tur a ni lo.

<!doctype html>
<html lang="en">
  ...
</html>

Meta tag chhang thei tak a ni

Bootstrap is developed mobile first , chu strategy a ni a, chu chu mobile devices tana code kan optimize hmasa a, chutah chuan CSS media query hmangin a tul angin components kan scale up thin. Device zawng zawng tana rendering leh touch zooming dik tak neih theih nan , i <head>.

<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

Hei hi a taka entir nan starter template ah hian i hmu thei ang .

Box-sizing a ni

CSS-a sizing awlsam zawk neih duh chuan global box-sizingvalue content-boxchu border-box. Hei hian paddingelement pakhat final computed width a nghawng lo tih a tichiang a, mahse third party software thenkhat Google Maps leh Google Custom Search Engine te ah harsatna a thlen thei a ni.

Override i mamawh hun tlemteah chuan a hnuaia mi ang hian hmang ang che:

.selector-for-some-widget {
  box-sizing: content-box;
}

A chunga snippet hmang hian nested elements—generated content via ::beforeleh te pawh tel— chumi atana ::aftertarlan chu an inherit vek angbox-sizing.selector-for-some-widget

Box model leh sizing chungchang hi CSS Tricks ah hian zir belh rawh .

Reboot leh rawh

Cross-browser rendering tihchangtlun nan Reboot kan hmang a, browser leh device hrang hranga inmil lohna siam\hat nan kan hmang a, chutih rualin HTML element tlangpuiah ngaihdan nei reset tlem zawk kan pe bawk.

Khawtlang

Bootstrap siam dan tur hriat reng la, heng thil \angkai tak tak hmang hian khawtlang hnenah thlen rawh.

  • The Official Bootstrap Blog hi chhiar la, subscribe rawh .
  • IRC-a Bootstrapper thawhpui te nen inbiakna nei rawh. irc.libera.chatServer ah chuan, channel #bootstrapah.
  • Implementation tanpuina chu Stack Overflow (tagged ) ah hian hmuh theih a bootstrap-4ni.
  • Developer te chuan npm emaw a ang chi delivery mechanism bootstraphmanga an sem chhuah hunah Bootstrap hnathawh dan siam danglam emaw tihpun emaw package-ah keyword hi an hmang tur a ni a, chu chu maximum discoverability atan an hmang tur a ni.

Twitter-ah @getbootstrap hi i follow thei bawk a , thuthang thar leh music video mak tak tak i hmu thei bawk.

CSP leh embedded SVG te pawh a awm bawk

Bootstrap component engemaw zatah hian kan CSS-ah hian embedded SVGs a awm a, chu chuan browser leh device hrang hrangah component hrang hrangte chu a inmil leh awlsam taka style turin a siam a ni. For organizations with more strict CSP configurations , kan embedded SVGs instance zawng zawng kan document vek a (chu zawng zawng chu via apply a ni background-image) chutiang chuan i duhthlannate uluk zawkin i enfiah thei ang.

Based on community conversation , i codebase-a hei hi address-na tur option thenkhat chu URL-te chu locally hosted assets hmanga thlak te, images te paih chhuah leh inline images hman (component zawng zawngah a theih loh), leh i CSP siam danglam te a ni. Kan rawtna chu nangmah ngeiin security policy te uluk taka enfiah a, a tul chuan hmalam panna kawng tha ber tur ngaihtuah hi a ni.