Bootstrap 5手风琴内容不显示

huangapple go评论71阅读模式
英文:

Bootstrap 5 Accordion Body Doesn't Appear

问题

I am in vscode and I am trying to create a website. I am also using Bootstrap 5 to help me create this website and I am trying to use Bootstrap 5 to create an accordion but when I click on the accordion there is no dropdown; the accordion body doesn't show. This is what it currently looks like Bootstrap 5手风琴内容不显示 The accordion section of the code can be found in the FAQ SECTION of the code (look for the FAQ SECTION comment)

Index.html

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

    <title>Your awesome title: </title>

    <meta name="description" content="Write an awesome description for your new site here. It will appear in your document head meta (for Google search results) and in your feed.xml site description." />
    
    <link rel="stylesheet" href="/_bridgetown/static/css/main.c7d4dd3f1984a290e9be.css" />
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="/index.css" />
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="/_bridgetown/static/js/main.96ffffaea92690057bfb.js" defer></script>
    <script type="module">
      let lastmod = 0
      function startReloadConnection() {
        const evtSource = new EventSource("/_bridgetown/live_reload")
        evtSource.onmessage = event => {
          if (event.data == "reloaded!") {
            location.reload()
          } else {
            const newmod = Number(event.data)
            if (lastmod > 0 && newmod > 0 && lastmod < newmod) {
              location.reload()
            } else {
              lastmod = newmod
            }
          }
        }
        evtSource.onerror = event => {
          if (evtSource.readyState === 2) {
            // reconnect with new object
            evtSource.close()
            console.warn("Live reload: attempting to reconnect in 3 seconds...")

            setTimeout(() => startReloadConnection(), 3000)
          }
        }
      }
      setTimeout(() => {
        startReloadConnection()
      }, 500)
    </script>
  </head>
  <body>

    <!-- NAVIGATION BAR START -->
    <nav class="navbar navbar-expand-lg navbar-light bg-white py-3">
      <div class="container">
        <a href="index.html">
          <img src="C:\Users\NewMayoAyo\Documents\_Dev\projects\assets\logo-topnav.png" alt=" logo" height="45" width="225" class="img-fluid"/>
        </a>

        <!-- TOGGLE MENU START -->
        <button
          type="button"
          class="navbar-toggler"
          data-bs-toggle="collapse"
          data-bs-target="#navmenu"
        >
          <span class="navbar-toggler-icon"></span>
        </button>
        <!-- TOGGLE MENU CLOSE -->

        <!-- TOGGLE MENU START -->
        <div class="collapse navbar-collapse" id="navmenu">
          <ul class="navbar-nav ms-auto">
            <li class="nav-item"><a href="#" class="nav-link">Home</a></li>
            <li class="nav-item"><a href="#" class="nav-link">About</a></li>
            <li class="nav-item"><a href="#" class="nav-link">Services</a></li>
            <li class="nav-item"><a href="#" class="nav-link">Contact</a></li>
          </ul>
        </div>
        <!-- TOGGLE MENU CLOSE -->
      </div>
    </nav>
    <!-- NAVIGATION BAR CLOSE -->

    <!-- SHOWCASE START -->
    <section class="bg-dark text-white text-center text-sm-start p-5 p-lg-0">
      <div class="container">
        <div class="d-flex align-items-center justify-content-center">
          <div>
            <h1><span class="text-primary"></span></h1>
            <p class="lead py-4">
              Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
              voluptatum, voluptate, quibusdam, quia voluptas quod quos
              exercitationem quae voluptatibus doloribus quidem. Quisquam
              voluptatum, voluptate, quibusdam, quia voluptas quod quos
              exercitationem quae voluptatibus doloribus quidem.
            </p>
            <button type="button" class="btn btn-primary">Get Quote</button>
          </div>
          <img src="-logo" alt=" logo" class="img-fluid d-none d-lg block"/>
        </div>
      </div>
    </section>
    <!-- SHOWCASE CLOSE -->

    <!-- FEATURE SECTION START -->
    <section>
      <div class="container">
        <div class="row bg-white mt-5 px-2">
          <div class="col-lg-6 col-sm-12">
            <img src="-logo" alt=" logo" class="img-fluid"/>
          </div>
          <div class="col-lg-6 col-sm-12">
            <h2 class="display-6">Get a Solution to all your IT Needs in One Place</h2>
            <hr>
            <p class="lead mt-5">
              Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
              voluptatum, voluptate, quibusdam, quia voluptas quod quos
              exercitationem quae voluptatibus doloribus quidem. Quisquam
              voluptatum, voluptate, quibusdam, quia voluptas quod quos
              exercitationem quae voluptatibus doloribus quidem.
            </p>
            <a href="#" class="btn btn-primary mt-3">Read More</a>
          </div>
        </div>
      </div>
    </section>
    <!-- FEATURE SECTION CLOSE -->

    <!-- TEAM SECTION START -->
    <section>
      <div class="container">
        <div class="row bg-white pt-5 px-2">
          <div class="col-lg-6 col-sm-12">
            <h2 class="display-6">Our Team</h2>
            <hr>
            <p class="lead mt-5">
              Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
              voluptatum, voluptate, quibusdam, quia voluptas quod quos
              exercitationem quae voluptatibus doloribus quidem. Quisquam
              voluptatum, voluptate, quibusdam, quia voluptas quod quos
              exercitationem quae voluptatibus doloribus quidem.
            </p>
            <a href="#" class="btn btn-primary mt-3">Read More</a>
          </

<details>
<summary>英文:</summary>

I am in vscode and I am trying to create a website. I am also using Bootstrap 5 to help me create this website and I am trying to use Bootstrap 5 to create an accordion but when I click on the accordion there is no dropdown; the accordion body doesn&#39;t show. This is what it currently looks like [![enter image description here][1]][1] The accordion section of the code can be found in the FAQ SECTION of the code (look for the FAQ SECTION comment)

## Index.html

```html
&lt;!doctype html&gt;
&lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
    &lt;meta charset=&quot;utf-8&quot; /&gt;
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; /&gt;

&lt;title&gt;Your awesome title: &lt;/title&gt;

&lt;meta name=&quot;description&quot; content=&quot;Write an awesome description for your new site here. It will appear in your document head meta (for Google search results) and in your feed.xml site description.&quot; /&gt;

&lt;link rel=&quot;stylesheet&quot; href=&quot;/_bridgetown/static/css/main.c7d4dd3f1984a290e9be.css&quot; /&gt;
&lt;link href=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; 
href=&quot;https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; 
href=&quot;https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;/index.css&quot; /&gt;
&lt;script src=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;/_bridgetown/static/js/main.96ffffaea92690057bfb.js&quot; defer&gt;&lt;/script&gt;
&lt;script type=&quot;module&quot;&gt;let lastmod = 0
function startReloadConnection() {
  const evtSource = new EventSource(&quot;/_bridgetown/live_reload&quot;)
  evtSource.onmessage = event =&gt; {
    if (event.data == &quot;reloaded!&quot;) {
      location.reload()
    } else {
      const newmod = Number(event.data)
      if (lastmod &gt; 0 &amp;&amp; newmod &gt; 0 &amp;&amp; lastmod &lt; newmod) {
        location.reload()
      } else {
        lastmod = newmod
      }
    }
  }
  evtSource.onerror = event =&gt; {
    if (evtSource.readyState === 2) {
      // reconnect with new object
      evtSource.close()
      console.warn(&quot;Live reload: attempting to reconnect in 3 seconds...&quot;)

      setTimeout(() =&gt; startReloadConnection(), 3000)
    }
  }
}
setTimeout(() =&gt; {
  startReloadConnection()
}, 500)
&lt;/script&gt;

  &lt;/head&gt;
  &lt;body&gt;
    
&lt;!-- NAVIGATION BAR START --&gt;
&lt;nav class=&quot;navbar navbar-expand-lg navbar-light bg-white py-3&quot;&gt;
  &lt;div class=&quot;container&quot;&gt;
    &lt;a href=&quot;index.html&quot;&gt;
      &lt;img src=&quot;C:\Users\NewMayoAyo\Documents\_Dev\projects\\assets\logo-topnav.png&quot; alt=&quot; logo&quot; height=&quot;45&quot; width=&quot;225&quot; class=&quot;img-fluid&quot;/&gt;
    &lt;/a&gt;

    &lt;!-- TOGGLE MENU START --&gt;
    &lt;button
      type=&quot;button&quot;
      class=&quot;navbar-toggler&quot;
      data-bs-toggle=&quot;collapse&quot;
      data-bs-target=&quot;#navmenu&quot;
    &gt;
      &lt;span class=&quot;navbar-toggler-icon&quot;&gt;
    &lt;/button&gt;
    &lt;!-- TOGGLE MENU CLOSE --&gt;

    &lt;!-- TOGGLE MENU START --&gt;
    &lt;div class=&quot;collapse navbar-collapse&quot; id=&quot;navmenu&quot;&gt;
      &lt;ul class=&quot;navbar-nav ms-auto&quot;&gt;
        &lt;li class=&quot;nav-item&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;nav-link&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
        &lt;li class=&quot;nav-item&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;nav-link&quot;&gt;About&lt;/a&gt;&lt;/li&gt;
        &lt;li class=&quot;nav-item&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;nav-link&quot;&gt;Services&lt;/a&gt;&lt;/li&gt;
        &lt;li class=&quot;nav-item&quot;&gt;&lt;a href=&quot;#&quot; class=&quot;nav-link&quot;&gt;Contact&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
    &lt;!-- TOGGLE MENU CLOSE --&gt;
  &lt;/div&gt;
 
&lt;/nav&gt;
&lt;!-- NAVIGATION BAR CLOSE --&gt;

&lt;!-- SHOWCASE START --&gt;
&lt;section class=&quot;bg-dark text-white text-center text-sm-start p-5 p-lg-0&quot;&gt;
  &lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;d-flex align-items-center justify-content-center&quot;&gt;
      &lt;div&gt;
        &lt;h1&gt;&lt;span class=&quot;text-primary&quot;&gt;&lt;/span&gt;&lt;/h1&gt;
        &lt;p class=&quot;lead py-4&quot;&gt;
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
          voluptatum, voluptate, quibusdam, quia voluptas quod quos
          exercitationem quae voluptatibus doloribus quidem. Quisquam
          voluptatum, voluptate, quibusdam, quia voluptas quod quos
          exercitationem quae voluptatibus doloribus quidem.
        &lt;/p&gt;
        &lt;button type=&quot;button&quot; class=&quot;btn btn-primary&quot;&gt;Get Quote&lt;/button&gt;
    &lt;/div&gt;
    &lt;img src=&quot;-logo&quot; alt=&quot; logo&quot; class=&quot;img-fluid d-none d-lg block&quot;/&gt;
  &lt;/div&gt;
&lt;/section&gt;
&lt;!-- SHOWCASE CLOSE --&gt;

&lt;!-- FEATURE SECTION START --&gt;
&lt;section&gt;
  &lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;row bg-white mt-5 px-2&quot;&gt;
      &lt;div class=&quot;col-lg-6 col-sm-12&quot;&gt;
        &lt;img src=&quot;-logo&quot; alt=&quot; logo&quot; class=&quot;img-fluid&quot;/&gt;
      &lt;/div&gt;
      &lt;div class=&quot;col-lg-6 col-sm-12&quot;&gt;
        &lt;h2 class=&quot;display-6&quot;&gt;Get a Solution to all your IT Needs in One Place&lt;/h2&gt;
        &lt;hr&gt;
        &lt;p class=&quot;lead mt-5&quot;&gt;
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
          voluptatum, voluptate, quibusdam, quia voluptas quod quos
          exercitationem quae voluptatibus doloribus quidem. Quisquam
          voluptatum, voluptate, quibusdam, quia voluptas quod quos
          exercitationem quae voluptatibus doloribus quidem.
        &lt;/p&gt;
        &lt;a href=&quot;#&quot; class=&quot;btn btn-primary mt-3&quot;&gt;Read More&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/section&gt;
&lt;!-- FEATURE SECTION CLOSE --&gt;

&lt;!-- TEAM SECTION START --&gt;
&lt;section&gt;
  &lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;row bg-white pt-5 px-2&quot;&gt;
      &lt;div class=&quot;col-lg-6 col-sm-12&quot;&gt;
        &lt;h2 class=&quot;display-6&quot;&gt;Our Team&lt;/h2&gt;
        &lt;hr&gt;
        &lt;p class=&quot;lead mt-5&quot;&gt;
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
          voluptatum, voluptate, quibusdam, quia voluptas quod quos
          exercitationem quae voluptatibus doloribus quidem. Quisquam
          voluptatum, voluptate, quibusdam, quia voluptas quod quos
          exercitationem quae voluptatibus doloribus quidem.
        &lt;/p&gt;
        &lt;a href=&quot;#&quot; class=&quot;btn btn-primary mt-3&quot;&gt;Read More&lt;/a&gt;
      &lt;/div&gt;
      &lt;div class=&quot;col-lg-6 col-sm-12&quot;&gt;
        
        &lt;img src=&quot;&quot; alt=&quot;&quot; class=&quot;img-fluid&quot;/&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/section&gt;
&lt;!-- TEAM SECTION CLOSE --&gt;

&lt;!-- USER DETAILS START --&gt;
&lt;section&gt;
  &lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;row text-center pt-4&quot;&gt;
		&lt;div class=&quot;col-lg-3 col-md-6&quot;&gt;
			&lt;i class=&quot;fas fa-user fa-3x&quot;&gt;&lt;/i&gt;
			&lt;h2 class=&quot;display-6&quot;&gt;100&lt;/h2&gt;
			&lt;p class=&quot;text-muted&quot;&gt;Active Clients&lt;/p&gt;
		  &lt;/div&gt;
		&lt;div class=&quot;col-lg-3 col-md-6&quot;&gt;
		  &lt;i class=&quot;fa-brands fa-windows fa-3x&quot;&gt;&lt;/i&gt;
		  &lt;h2 class=&quot;display-6&quot;&gt;500&lt;/h2&gt;
		  &lt;p class=&quot;text-muted&quot;&gt;Positive Reviews&lt;/p&gt;
		&lt;/div&gt;
		&lt;div class=&quot;col-lg-3 col-md-6&quot;&gt;
			&lt;i class=&quot;fa-brands fa-windows fa-3x&quot;&gt;&lt;/i&gt;
			&lt;h2 class=&quot;display-6&quot;&gt;100&lt;/h2&gt;
			&lt;p class=&quot;text-muted&quot;&gt;Active Clients&lt;/p&gt;
		  &lt;/div&gt;
		  &lt;div class=&quot;col-lg-3 col-md-6&quot;&gt;
			&lt;i class=&quot;fa-brands fa-windows fa-3x&quot;&gt;&lt;/i&gt;
			&lt;h2 class=&quot;display-6&quot;&gt;100&lt;/h2&gt;
			&lt;p class=&quot;text-muted&quot;&gt;Active Clients&lt;/p&gt;
	&lt;/div&gt;
    
	  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
&lt;/section&gt;
&lt;!-- USER DETAILS CLOSE --&gt;

&lt;!-- WEBSITE SECTION START --&gt;
&lt;section&gt;
	&lt;div class=&quot;container&quot;&gt;
	  &lt;div class=&quot;row bg-dark py-5 px-2 text-white&quot;&gt;
		&lt;div class=&quot;col-lg-12 col-sm-12 text-center&quot;&gt;
		  &lt;p&gt;2023 IT Leaders&lt;/p&gt;
		  &lt;h2&gt;Get a Soltion to your Problems&lt;/h2&gt;
		  &lt;a href=&quot;#&quot; class=&quot;btn btn-primary mt-3&quot;&gt;Read More&lt;/a&gt;
		&lt;/div&gt;
		
	  &lt;/div&gt;
	&lt;/div&gt;
  &lt;/section&gt;
  &lt;!-- WEBSITE SECTION CLOSE --&gt;

  &lt;!-- SERVICES SECTION START --&gt;
  &lt;section&gt;
	&lt;div class=&quot;container&quot;&gt;
		&lt;div class=&quot;row py-5&quot;&gt;
			&lt;h2 class=&quot;display-6 mb-4&quot;&gt;Our Services&lt;/h2&gt;
			&lt;!-- &lt;div class=&quot;col-lg-4 col-md-6&quot;&gt;
				&lt;div class=&quot;card text-center p-4 mb-2&quot;&gt;
					&lt;i class=&quot;fas fa-camera fa-3x&quot;&gt;&lt;/i&gt;
					&lt;h4&gt;CCTV Services&lt;/h4&gt;
					&lt;p class=&quot;p-2&quot;&gt;
						Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
						voluptatum, voluptate, quibusdam, quia voluptas quod quos
						exercitationem quae voluptatibus doloribus quidem. Quisquam
					&lt;/p&gt;
				&lt;/div&gt;
      &lt;/div&gt; --&gt;
        &lt;div class=&quot;col-lg-4 col-md-6&quot;&gt;
          &lt;div class=&quot;card text-center p-4 mb-2 crd&quot;&gt;
            &lt;i class=&quot;fas fa-database fa-3x&quot;&gt;&lt;/i&gt;
            &lt;h4&gt;Datacenter Support&lt;/h4&gt;
            &lt;p class=&quot;p-2&quot;&gt;
              Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
              voluptatum, voluptate, quibusdam, quia voluptas quod quos
              exercitationem quae voluptatibus doloribus quidem. Quisquam
            &lt;/p&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;!-- &lt;div class=&quot;col-lg-4 col-md-6&quot;&gt;
          &lt;div class=&quot;card text-center p-4 mb-2&quot;&gt;
            &lt;i class=&quot;fas fa-sign-hanging fa-3x&quot;&gt;&lt;/i&gt;
            &lt;h4&gt;Digital Signage&lt;/h4&gt;
            &lt;p class=&quot;p-2&quot;&gt;
              Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
              voluptatum, voluptate, quibusdam, quia voluptas quod quos
              exercitationem quae voluptatibus doloribus quidem. Quisquam
            &lt;/p&gt;
          &lt;/div&gt;
        &lt;/div&gt; --&gt;
        &lt;div class=&quot;col-lg-4 col-md-6&quot;&gt;
          &lt;div class=&quot;card text-center p-4 mb-2 crd&quot;&gt;
            &lt;i class=&quot;fas fa-headset fa-3x&quot;&gt;&lt;/i&gt;
            &lt;h4&gt;General Support&lt;/h4&gt;
            &lt;p class=&quot;p-2&quot;&gt;
              Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
              voluptatum, voluptate, quibusdam, quia voluptas quod quos
              exercitationem quae voluptatibus doloribus quidem. Quisquam
            &lt;/p&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;col-lg-4 col-md-6&quot;&gt;
          &lt;div class=&quot;card text-center p-4 mb-2 crd&quot;&gt;
            &lt;i class=&quot;fas fa-server fa-3x&quot;&gt;&lt;/i&gt;
            &lt;h4&gt;Network Support&lt;/h4&gt;
            &lt;p class=&quot;p-2&quot;&gt;
              Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
              voluptatum, voluptate, quibusdam, quia voluptas quod quos
              exercitationem quae voluptatibus doloribus quidem. Quisquam
            &lt;/p&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;col-lg-4 col-md-6&quot;&gt;
          &lt;div class=&quot;card text-center p-4 mb-2 crd&quot;&gt;
            &lt;i class=&quot;fas fa-cash-register fa-3x&quot;&gt;&lt;/i&gt;
            &lt;h4&gt;POS Services&lt;/h4&gt;
            &lt;p class=&quot;p-2&quot;&gt;
              Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
              voluptatum, voluptate, quibusdam, quia voluptas quod quos
              exercitationem quae voluptatibus doloribus quidem. Quisquam
            &lt;/p&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class=&quot;col-lg-4 col-md-6&quot;&gt;
          &lt;div class=&quot;card text-center p-4 mb-2 crd&quot;&gt;
            &lt;i class=&quot;fas fa-tower-cell fa-3x&quot;&gt;&lt;/i&gt;
            &lt;h4&gt;Telecom Services&lt;/h4&gt;
            &lt;p class=&quot;p-2&quot;&gt;
              Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
              voluptatum, voluptate, quibusdam, quia voluptas quod quos
              exercitationem quae voluptatibus doloribus quidem. Quisquam
            &lt;/p&gt;
          &lt;/div&gt;
			  &lt;/div&gt;
      &lt;div class=&quot;col-lg-4 col-md-6&quot;&gt;
        &lt;div class=&quot;card text-center p-4 mb-2 crd&quot;&gt;
          &lt;i class=&quot;fa-solid fa-bars fa-3x&quot;&gt;&lt;/i&gt;
          &lt;h4&gt;Additional Services&lt;/h4&gt;
          &lt;p class=&quot;p-2&quot;&gt;
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Quisquam
              voluptatum, voluptate, quibusdam, quia voluptas quod quos
              exercitationem quae voluptatibus doloribus quidem. Quisquam
          &lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;
  &lt;/section&gt;
  &lt;!-- SERVICES SECTION CLOSE --&gt;

  &lt;!-- FAQ SECTION START --&gt;
  &lt;section&gt;
    &lt;div class=&quot;container&quot;&gt;
      &lt;div class=&quot;row py-2&quot;&gt;
        &lt;h2  class=&quot;display-6&quot;&gt;Freqently Asked Questions&lt;/h2&gt;
        &lt;div class=&quot;col-lg-6 col-md-6 text-center&quot;&gt;
          &lt;div class=&quot;accordion accordion-flush&quot; id=&quot;accordionflush&quot;&gt;
              &lt;div class=&quot;accordion-item&quot;&gt;
                &lt;h2 class=&quot;accordion-header&quot; id=&quot;flush-headingOne&quot;&gt;
                  &lt;button
 
                    class=&quot;accordion-button collapsed&quot; 
                    type=&quot;button&quot;
                    data-bs-toggle=&quot;collapse&quot; 
                    data-bs-target=&quot;#flush-CollapseOne&quot;
                  &gt;
                    Nulla do magna aliquip elit culpa. 
                  &lt;/button&gt;
                &lt;/h2&gt;
                &lt;div 
                  id=&quot;#flush-CollapseOne&quot; 
                  class=&quot;accordion-collapse collapse&quot; 
                  data-bs-parent=&quot;#accordionflush&quot;
                &gt;
                  &lt;div class=&quot;accordion-body&quot;&gt;
                    Elit elit irure ad deserunt. Ipsum aliquip amet amet sit duis excepteur. Sit commodo duis aliqua amet. Deserunt Lorem nulla ut pariatur id eiusmod aliqua est nostrud Lorem et nostrud nostrud.
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class=&quot;col-lg-6 col-md-6 text-center&quot;&gt;
            &lt;img src=&quot;./assets/logo-topnav.png&quot; alt=&quot;&quot; class=&quot;img fluid&quot; /&gt;
          &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/section&gt;
        
  &lt;!-- FAQ SECTION CLOSE --&gt;
  &lt;/body&gt;
&lt;/html&gt;

Index.css

@import url(&#39;https://fonts.googleapis.com/css2?family=Poppins&amp;display=swap&#39;);
body {
	background: #f1f2fa;
	font-family: &#39;Poppins&#39;, sans-serif;
}

hr {
	border: 1.5px solid #0b5ed7
}

.crd {
	background-color: #f1f2fa;
	transition: all;
}

.crd:hover {
	background: #0b5ed7;
	color: #fff;
	transition: 0.5s;
}

答案1

得分: 0

你尚未添加data-bs-parent和aria-labelledby属性。

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

<head>
   <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</head>

<body>
 <section>
        <div class="container">
            <div class="row py-2">
                <h2 class="display-6">Freqently Asked Questions</h2>
                <div class="col-lg-6 col-md-6 text-center">
                    <div class="accordion accordion-flush" id="accordionFlushExample">
                        <div class="accordion-item">
                            <h2 class="accordion-header" id="flush-headingOne">
                                <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
                                    data-bs-target="#flush-CollapseOne" aria-expanded="false"
                                    aria-controls="flush-collapseOne">
                                    Nulla do magna aliquip elit culpa.
                                </button>
                            </h2>
                            <div id="flush-collapseOne" class="accordion-collapse collapse"
                                aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushExample">
                                <div class="accordion-body">Placeholder content for this accordion, which is intended to
                                    demonstrate the <code>.accordion-flush</code> class. This is the first item's
                                    accordion body.</div>
                            </div>
                            <div id="flush-CollapseOne" class="accordion-collapse collapse"
                                aria-labelledby="flush-headingOne" data-bs-parent="#accordionFlushExample">
                                <div class="accordion-body">
                                    Elit elit irure ad deserunt. Ipsum aliquip amet amet sit duis excepteur. Sit commodo
                                    duis aliqua amet. Deserunt Lorem nulla ut pariatur id eiusmod aliqua est nostrud
                                    Lorem et nostrud nostrud.
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-6 col-md-6 text-center">
                    <img src="./assets/logo-topnav.png" alt="" class="img fluid" />
                </div>
            </div>
        </div>
    </section>
    <!-- FAQ SECTION CLOSE -->
</body>

</html>
英文:

You have not added data-bs-parent and aria-labelledby attributes

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

&lt;!doctype html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
&lt;link href=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css&quot; rel=&quot;stylesheet&quot;&gt;
&lt;script src=&quot;https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;section&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;row py-2&quot;&gt;
&lt;h2 class=&quot;display-6&quot;&gt;Freqently Asked Questions&lt;/h2&gt;
&lt;div class=&quot;col-lg-6 col-md-6 text-center&quot;&gt;
&lt;div class=&quot;accordion accordion-flush&quot; id=&quot;accordionFlushExample&quot;&gt;
&lt;div class=&quot;accordion-item&quot;&gt;
&lt;h2 class=&quot;accordion-header&quot; id=&quot;flush-headingOne&quot;&gt;
&lt;button class=&quot;accordion-button collapsed&quot; type=&quot;button&quot; data-bs-toggle=&quot;collapse&quot;
data-bs-target=&quot;#flush-CollapseOne&quot; aria-expanded=&quot;false&quot;
aria-controls=&quot;flush-collapseOne&quot;&gt;
Nulla do magna aliquip elit culpa.
&lt;/button&gt;
&lt;/h2&gt;
&lt;div id=&quot;flush-collapseOne&quot; class=&quot;accordion-collapse collapse&quot;
aria-labelledby=&quot;flush-headingOne&quot; data-bs-parent=&quot;#accordionFlushExample&quot;&gt;
&lt;div class=&quot;accordion-body&quot;&gt;Placeholder content for this accordion, which is intended to
demonstrate the &lt;code&gt;.accordion-flush&lt;/code&gt; class. This is the first item&#39;s
accordion body.&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;flush-CollapseOne&quot; class=&quot;accordion-collapse collapse&quot;
aria-labelledby=&quot;flush-headingOne&quot; data-bs-parent=&quot;#accordionFlushExample&quot;&gt;
&lt;div class=&quot;accordion-body&quot;&gt;
Elit elit irure ad deserunt. Ipsum aliquip amet amet sit duis excepteur. Sit commodo
duis aliqua amet. Deserunt Lorem nulla ut pariatur id eiusmod aliqua est nostrud
Lorem et nostrud nostrud.
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;col-lg-6 col-md-6 text-center&quot;&gt;
&lt;img src=&quot;./assets/logo-topnav.png&quot; alt=&quot;&quot; class=&quot;img fluid&quot; /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;!-- FAQ SECTION CLOSE --&gt;
&lt;/body&gt;
&lt;/html&gt;

<!-- end snippet -->

huangapple
  • 本文由 发表于 2023年7月10日 10:54:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/76650420.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定