Kalo te përmbajtja kryesore Kalo te navigimi i dokumenteve
Check
in English

Filloni me Bootstrap

Bootstrap është një paketë veglash e fuqishme, e mbushur me veçori. Ndërtoni çdo gjë - nga prototipi tek prodhimi - në minuta.

Fillim i shpejte

Filloni duke përfshirë CSS dhe JavaScript të gatshme për prodhim të Bootstrap përmes CDN pa pasur nevojë për ndonjë hap ndërtimi. Shihni atë në praktikë me këtë demonstrim të Bootstrap CodePen .


  1. Krijoni një index.htmlskedar të ri në rrënjën e projektit tuaj. Përfshini edhe <meta name="viewport">etiketën për sjelljen e duhur të reagimit në pajisjet celulare.

    <!doctype html>
    <html lang="en">
      <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Bootstrap demo</title>
      </head>
      <body>
        <h1>Hello, world!</h1>
      </body>
    </html>
    
  2. Përfshi CSS dhe JS të Bootstrap. Vendoseni <link>etiketën në <head>për CSS-në tonë dhe <script>etiketën për paketën tonë JavaScript (duke përfshirë Popper për pozicionimin e pikave me zbritje, poppers dhe këshillat e veglave) përpara mbylljes </body>. Mësoni më shumë rreth lidhjeve tona CDN .

    <!doctype html>
    <html lang="en">
      <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Bootstrap demo</title>
        <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
      </head>
      <body>
        <h1>Hello, world!</h1>
        <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8" crossorigin="anonymous"></script>
      </body>
    </html>
    

    Ju gjithashtu mund të përfshini Popper dhe JS-në tonë veç e veç. Nëse nuk planifikoni të përdorni skedarë me zbritje, popover ose këshilla veglash, kurseni disa kilobajt duke mos përfshirë Popper.

    <script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz" crossorigin="anonymous"></script>
    
  3. Përshendetje Botë! Hapni faqen në shfletuesin tuaj të zgjedhur për të parë faqen tuaj Bootstrapped. Tani mund të filloni të ndërtoni me Bootstrap duke krijuar strukturën tuaj , duke shtuar dhjetëra komponentë dhe duke përdorur shembujt tanë zyrtarë .

Si referencë, këtu janë lidhjet tona kryesore CDN.

Përshkrim URL
CSS https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css
JS https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js

Ju gjithashtu mund të përdorni CDN për të marrë ndonjë nga ndërtimet tona shtesë të listuara në faqen e Përmbajtjes .

Hapat e ardhshëm

komponentët JS

Jeni kurioz se cilët komponentë kërkojnë në mënyrë të qartë JavaScript dhe Popper tonë? Klikoni lidhjen e shfaqjes së komponentëve më poshtë. Nëse nuk jeni aspak të sigurt për strukturën e përgjithshme të faqes, vazhdoni të lexoni për një model faqeje shembull.

Shfaq komponentët që kërkojnë JavaScript
  • Sinjalizime për shkarkim
  • Butonat për ndryshimin e gjendjeve dhe kutinë e zgjedhjes/funksionalitetin e radios
  • Carousel për të gjitha sjelljet, kontrollet dhe treguesit e rrëshqitjes
  • Palos për ndryshimin e dukshmërisë së përmbajtjes
  • Dropdowns për shfaqje dhe pozicionim (kërkon gjithashtu Popper )
  • Modals for displaying, positioning, and scroll behavior
  • Navbar for extending our Collapse and Offcanvas plugins to implement responsive behaviors
  • Navs with the Tab plugin for toggling content panes
  • Offcanvases for displaying, positioning, and scroll behavior
  • Scrollspy for scroll behavior and navigation updates
  • Toasts for displaying and dismissing
  • Tooltips and popovers for displaying and positioning (also requires Popper)

Important globals

Bootstrap employs a handful of important global styles and settings, all of which are almost exclusively geared towards the normalization of cross browser styles. Let’s dive in.

HTML5 doctype

Bootstrap requires the use of the HTML5 doctype. Without it, you’ll see some funky and incomplete styling.

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

Responsive meta tag

Bootstrap is developed mobile first, a strategy in which we optimize code for mobile devices first and then scale up components as necessary using CSS media queries. To ensure proper rendering and touch zooming for all devices, add the responsive viewport meta tag to your <head>.

<meta name="viewport" content="width=device-width, initial-scale=1">

You can see an example of this in action in the quick start.

Box-sizing

For more straightforward sizing in CSS, we switch the global box-sizing value from content-box to border-box. This ensures padding does not affect the final computed width of an element, but it can cause problems with some third-party software like Google Maps and Google Custom Search Engine.

On the rare occasion you need to override it, use something like the following:

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

With the above snippet, nested elements—including generated content via ::before and ::after—will all inherit the specified box-sizing for that .selector-for-some-widget.

Learn more about box model and sizing at CSS Tricks.

Reboot

For improved cross-browser rendering, we use Reboot to correct inconsistencies across browsers and devices while providing slightly more opinionated resets to common HTML elements.

Community

Stay up-to-date on the development of Bootstrap and reach out to the community with these helpful resources.

  • Read and subscribe to The Official Bootstrap Blog.
  • Ask and explore our GitHub Discussions.
  • Chat with fellow Bootstrappers in IRC. On the irc.libera.chat server, in the #bootstrap channel.
  • Implementation help may be found at Stack Overflow (tagged bootstrap-5).
  • Developers should use the keyword bootstrap on packages that modify or add to the functionality of Bootstrap when distributing through npm or similar delivery mechanisms for maximum discoverability.

You can also follow @getbootstrap on Twitter for the latest gossip and awesome music videos.