Source

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, jsDelivr-a mite chuan a thlawnin an pe a ni. Package manager hmangin nge source files download a ngai em? Downloads page ah chuan 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-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" 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.js , leh kan JavaScript plugins te an mamawh a ni. A hnuaia <script>s te hi i page tawp ber bulah, closing </body>tag hma lawkah dah la, an enable theih nan. jQuery hi a rawn lang hmasa tur a ni a, chutah chuan Popper.js a rawn lang leh tur a ni a, chutah chuan kan JavaScript plugins te hi a rawn lang leh tur a ni.

jQuery-a slim build kan hmang a, mahse full version pawh a support bawk.

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

Eng component nge chiang taka jQuery, kan JS, leh Popper.js te mamawh tih hriat duh em? A hnuaia show components link ah hian click la. General page structure chungchangah i chiang lo tak tak a nih 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.js pawh a ngai bawk )
  • Modals te chu a lantir dan tur, a awmna tur hmun tur a ni a, scroll behavior te pawh a awm bawk
  • Navbar hmangin kan Collapse plugin chu responsive behavior implement turin kan tizau a ni
  • Tooltips leh popovers te entir leh positioning tur ( Popper.js pawh a ngai bawk )
  • Scroll awm dan leh navigation update te chu scrollspy hmangin

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-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

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

    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" 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 chhuah dan tur hriat reng la, heng thil \angkai tak tak hmang hian khawtlang hnenah thlen rawh.

  • Twitter ah @getbootstrap hi lo follow ve rawh le .
  • The Official Bootstrap Blog chhiar la, subscribe rawh .
  • IRC-a Bootstrapper thawhpui te nen inbiakna nei rawh. irc.freenode.netServer 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.