મુખ્ય સામગ્રી પર જાઓ ડૉક્સ નેવિગેશન પર જાઓ
in English

પરિચય

jsDelivr અને ટેમ્પલેટ સ્ટાર્ટર પૃષ્ઠ સાથે, પ્રતિભાવશીલ, મોબાઇલ-પ્રથમ સાઇટ્સ બનાવવા માટે વિશ્વનું સૌથી લોકપ્રિય માળખું, Bootstrap સાથે પ્રારંભ કરો.

ઝડપી શરૂઆત

તમારા પ્રોજેક્ટમાં ઝડપથી બુટસ્ટ્રેપ ઉમેરવા માંગો છો? jsDelivr નો ઉપયોગ કરો, એક મફત ઓપન સોર્સ CDN. પેકેજ મેનેજરનો ઉપયોગ કરી રહ્યાં છો અથવા સ્રોત ફાઇલો ડાઉનલોડ કરવાની જરૂર છે? ડાઉનલોડ પૃષ્ઠ પર જાઓ .

CSS

અમારી CSS લોડ કરવા માટે અન્ય તમામ સ્ટાઈલશીટ્સ પહેલા <link>તમારી સ્ટાઈલશીટને કોપી-પેસ્ટ કરો .<head>

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

જે.એસ

અમારા ઘણા ઘટકોને કાર્ય કરવા માટે JavaScript નો ઉપયોગ કરવાની જરૂર છે. ખાસ કરીને, તેમને અમારા પોતાના JavaScript પ્લગઇન્સ અને પોપરની જરૂર છે . નીચેનામાંથી એકને તમારા પૃષ્ઠોના <script>અંતની નજીક, બંધ </body>ટેગની બરાબર પહેલાં, તેમને સક્ષમ કરવા માટે મૂકો .

બંડલ

અમારા બે બંડલમાંથી એક સાથે દરેક બુટસ્ટ્રેપ JavaScript પ્લગઇન અને નિર્ભરતા શામેલ કરો. બંને bootstrap.bundle.jsઅને અમારી ટૂલટિપ્સ અને પોપોવર્સ માટે પોપરનોbootstrap.bundle.min.js સમાવેશ કરો. બુટસ્ટ્રેપમાં શું શામેલ છે તે વિશે વધુ માહિતી માટે, કૃપા કરીને અમારો વિષયવસ્તુ વિભાગ જુઓ.

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>

અલગ

જો તમે અલગ સ્ક્રિપ્ટ્સ સોલ્યુશન સાથે જવાનું નક્કી કરો છો, તો પોપર પ્રથમ આવવું જોઈએ (જો તમે ટૂલટિપ્સ અથવા પોપોવર્સનો ઉપયોગ કરી રહ્યાં છો), અને પછી અમારા JavaScript પ્લગઈન્સ.

<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>

મોડ્યુલ્સ

જો તમે ઉપયોગ કરો છો, તો કૃપા કરીને અમારા બુટસ્ટ્રેપને મોડ્યુલ વિભાગ તરીકે વાપરવાનો <script type="module">સંદર્ભ લો .

ઘટકો

ઉત્સુક છે કે કયા ઘટકોને સ્પષ્ટપણે અમારી JavaScript અને પોપરની જરૂર છે? નીચે દર્શાવેલ ઘટકોની લિંક પર ક્લિક કરો. જો તમે સામાન્ય પૃષ્ઠ બંધારણ વિશે બિલકુલ અચોક્કસ હો, તો ઉદાહરણ પૃષ્ઠ નમૂના માટે વાંચવાનું ચાલુ રાખો.

JavaScript જરૂરી ઘટકો બતાવો
  • બરતરફી માટે ચેતવણીઓ
  • ટૉગલ સ્ટેટ્સ અને ચેકબૉક્સ/રેડિયો કાર્યક્ષમતા માટેના બટનો
  • તમામ સ્લાઇડ વર્તણૂકો, નિયંત્રણો અને સૂચકાંકો માટે કેરોયુઝલ
  • સામગ્રીની દૃશ્યતા ટૉગલ કરવા માટે સંકુચિત કરો
  • ડિસ્પ્લે અને પોઝિશનિંગ માટે ડ્રોપડાઉન ( પોપર પણ જરૂરી છે )
  • પ્રદર્શન, સ્થિતિ અને સ્ક્રોલ વર્તન માટેના મોડલ્સ
  • પ્રતિભાવશીલ વર્તણૂકને અમલમાં મૂકવા માટે અમારા સંકુચિત પ્લગઇનને વિસ્તારવા માટે નવબાર
  • પ્રદર્શિત કરવા અને બરતરફ કરવા માટે ટોસ્ટ્સ
  • ડિસ્પ્લે અને પોઝિશનિંગ માટે ટૂલટિપ્સ અને પોપોવર્સ ( પોપર પણ જરૂરી છે )
  • સ્ક્રોલ વર્તન અને નેવિગેશન અપડેટ્સ માટે Scrollspy

સ્ટાર્ટર ટેમ્પલેટ

તમારા પૃષ્ઠોને નવીનતમ ડિઝાઇન અને વિકાસ ધોરણો સાથે સેટ કરવાની ખાતરી કરો. તેનો અર્થ એ છે કે HTML5 doctype નો ઉપયોગ કરવો અને યોગ્ય પ્રતિભાવશીલ વર્તણૂકો માટે વ્યુપોર્ટ મેટા ટેગનો સમાવેશ કરવો. તે બધાને એકસાથે મૂકો અને તમારા પૃષ્ઠો આના જેવા દેખાવા જોઈએ:

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

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

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

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

    <!-- Option 1: Bootstrap Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>

    <!-- Option 2: Separate Popper and Bootstrap JS -->
    <!--
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
    -->
  </body>
</html>

For next steps, visit the Layout docs or our official examples to start laying out your site’s content and components.

Important globals

Bootstrap employs a handful of important global styles and settings that you’ll need to be aware of when using it, 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 incomplete styling, but including it shouldn’t cause any considerable hiccups.

<!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 starter template.

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.
  • 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.