英文:
Put form fields next to accordion
问题
请问有人能告诉我为什么表单字段不会显示在屏幕右侧吗?即使使用col-6
也是如此?
Code pen:
https://codepen.io/ogonzales/pen/abjgabQ
实际情况:
预期情况:
英文:
may someone tell me why the form fields don't get displayed on the right of the screen? Even when using col-6
?
Code pen:
https://codepen.io/ogonzales/pen/abjgabQ
As is:
Expected:
答案1
得分: 1
你忘记在第64行关闭了.col-6 div
:
请检查以下代码:
<div class="row">
<div class="col-6">
<div class="accordion" id="accordionExample">
<div class="accordion-item">
<h2 class="accordion-header" id="headingOne">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne"> Requisitos </button>
</h2>
<div id="collapseOne" class="accordion-collapse collapse show" aria-labelledby="headingOne" data-bs-parent="#accordionExample">
<div class="accordion-body">
<strong> Ser mayor de 10 años y contar con una computadora (o laptop) y conexión a internet. </strong> Debido a que las clases serán online, el estudiante necesita contar con una computadora para unirse. En su defecto, puede el estudiante podrá unirse desde un dispositivo móvil (celular). <code>.accordion-body</code>, though the transition does limit overflow.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="headingTwo">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> Características y dictado del curso </button>
</h2>
<div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo" data-bs-parent="#accordionExample">
<div class="accordion-body">
<strong> ¿Cómo será el dictado de clases bajo esta modalidad? </strong> Deberás conectarte con tu profesor y compañeros a través de la Plataforma de Videoconferencia Zoom, en el horario y frecuencia de clase que elegiste para el presente ciclo. En esta modalidad, el docente te acompañará siempre en tiempo real, durante los días y horario de clases, facilitando tu aprendizaje. ¡El logro de tus metas no se detiene!
</div>
</div>
</div>
<div class "accordion-item">
<h2 class="accordion-header" id="headingThree">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree"> Niveles, ciclos y horarios </button>
</h2>
<div id="collapseThree" class="accordion-collapse collapse" aria-labelledby="headingThree" data-bs-parent="#accordionExample">
<div class="accordion-body">
<table class="table">
<thead>
<tr>
<th>a</th>
<th>b</th>
<th>c</th>
<th>d</th>
</tr>
</thead>
<tbody>
<tr>
<td>row 1, column 1</td>
<td>row 1, column 2</td>
<td>row 1, column 3</td>
<td>row 1, column 4</td>
</tr>
<tr>
<td>row 2, column 1</td>
<td>row 2, column 2</td>
<td>row 2, column 3</td>
<td>row 2, column 4</td>
</tr>
<tr>
<td>row 3, column 1</td>
<td>row 3, column 2</td>
<td>row 3, column 3</td>
<td>row 3, column 4</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div> <!-- 您没有在这里关闭 .col-6 的 div -->
<div class="col-6">
<!--=================================
Contact Us -->
<section class="space-ptb">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8 text-center">
<div class="section-title">
<h2>Get In Touch</h2>
<p>If success is a process with a number of defined steps, then it is just like any other process. So, what is the first step in any process?</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-9">
<form class="row fill-form mb-4 mb-md-0 form-flat-style">
<div class="mb-3 col-sm-6">
<label class="form-label">Name</label>
<input type="text" class="form-control" placeholder="">
</div>
<div class="mb-3 col-sm-6">
<label class="form-label">Email</label>
<input type="email" class="form-control" placeholder="">
</div>
<div class="mb-3 col-sm-6">
<label class="form-label">Subject</label>
<input type="text" class="form-control" placeholder="">
</div>
<div class="mb-3 col-sm-6">
<label class="form-label">Phone</label>
<input type="text" class="form-control" placeholder="">
</div>
<div class="mb-3 col-sm-12">
<label class="form-label">Message</label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="5"></textarea>
</div>
<div class="mb-3 col-sm-12">
<button type="submit" class="btn btn-primary">Send us</button>
</div>
</form>
</div>
<div class="col-md-3">
<h4 class="mb-4">Contact Detail</h4>
<p class="mb-2">6580 Allison Turnpike Creminfort, AL 32808-4509</p>
<p class="mb-2">
<b class="text-dark">Call us:</b> +123 4567 8910
</p>
<p class="mb-4">
<b class="text-dark">Mail us:</b> support@online-courses.com
</p>
<div class="social-icon-round icon-sm">
<ul>
<li>
<a href="#">
<i class="fab fa-facebook-f"></i>
</a>
</li>
<li>
<a href="#">
<i class="fab fa-twitter"></i>
</a>
</li>
<li>
<a href="#">
<i class="fab fa-linkedin-in"></i>
</a>
<details>
<summary>英文:</summary>
You have forgot to close .col-6 div **</div>** on the line number 64:
Please check the below code:
<div class="row">
<div class="col-6">
<div class="accordion" id="accordionExample">
<div class="accordion-item">
<h2 class="accordion-header" id="headingOne">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne"> Requisitos </button>
</h2>
<div id="collapseOne" class="accordion-collapse collapse show" aria-labelledby="headingOne" data-bs-parent="#accordionExample">
<div class="accordion-body">
<strong>Ser mayor de 10 años y contar con una computadora (o laptop) y conexión a internet.</strong> Debido a que las clases serán online, el estudiante necesita contar con una computadora para unirse. En su defecto, puede el estudiante podrá unirse desde un dispositivo móvil (celular). <code>.accordion-body</code>, though the transition does limit overflow.
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="headingTwo">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"> Características y disctado del curso </button>
</h2>
<div id="collapseTwo" class="accordion-collapse collapse" aria-labelledby="headingTwo" data-bs-parent="#accordionExample">
<div class="accordion-body">
<strong>¿Cómo será el dictado de clases bajo esta modalidad?</strong> Deberás conectarte con tu profesor y compañeros a través de la Plataforma de Videoconferencia Zoom, en el horario y frecuencia de clase que elegiste para el presente ciclo. En esta modalidad, el docente te acompañará siempre en tiempo real, durante los días y horario de clases, facilitando tu aprendizaje. Por ello, ¡El logro de tus metas no se detiene!
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="headingThree">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree"> Niveles, ciclos y horarios </button>
</h2>
<div id="collapseThree" class="accordion-collapse collapse" aria-labelledby="headingThree" data-bs-parent="#accordionExample">
<div class="accordion-body">
<table class="table">
<thead>
<tr>
<th>a</th>
<th>b</th>
<th>c</th>
<th>d</th>
</tr>
</thead>
<tbody>
<tr>
<td>row 1, column 1</td>
<td>row 1, column 2</td>
<td>row 1, column 3</td>
<td>row 1, column 4</td>
</tr>
<tr>
<td>row 2, column 1</td>
<td>row 2, column 2</td>
<td>row 2, column 3</td>
<td>row 2, column 4</td>
</tr>
<tr>
<td>row 3, column 1</td>
<td>row 3, column 2</td>
<td>row 3, column 3</td>
<td>row 3, column 4</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div> <!-- YOU DID NOT CLOSE THE DIV .col-6 HERE -->
<div class="col-6">
<!--=================================
Contact Us -->
<section class="space-ptb">
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8 text-center">
<div class="section-title">
<h2>Get In Touch</h2>
<p>If success is a process with a number of defined steps, then it is just like any other process. So, what is the first step in any process?</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-9">
<form class="row fill-form mb-4 mb-md-0 form-flat-style">
<div class="mb-3 col-sm-6">
<label class="form-label">Name</label>
<input type="text" class="form-control" placeholder="">
</div>
<div class="mb-3 col-sm-6">
<label class="form-label">Email</label>
<input type="email" class="form-control" placeholder="">
</div>
<div class="mb-3 col-sm-6">
<label class="form-label">Subject</label>
<input type="text" class="form-control" placeholder="">
</div>
<div class="mb-3 col-sm-6">
<label class="form-label">Phone</label>
<input type="text" class="form-control" placeholder="">
</div>
<div class="mb-3 col-sm-12">
<label class="form-label">Message</label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="5"></textarea>
</div>
<div class="mb-3 col-sm-12">
<button type="submit" class="btn btn-primary">Send us</button>
</div>
</form>
</div>
<div class="col-md-3">
<h4 class="mb-4">Contact Detail</h4>
<p class="mb-2">6580 Allison Turnpike Creminfort, AL 32808-4509</p>
<p class="mb-2">
<b class="text-dark">Call us:</b> +123 4567 8910
</p>
<p class="mb-4">
<b class="text-dark">Mail us:</b> support@online-courses.com
</p>
<div class="social-icon-round icon-sm">
<ul>
<li>
<a href="#">
<i class="fab fa-facebook-f"></i>
</a>
</li>
<li>
<a href="#">
<i class="fab fa-twitter"></i>
</a>
</li>
<li>
<a href="#">
<i class="fab fa-linkedin-in"></i>
</a>
</li>
<li>
<a href="#">
<i class="fab fa-instagram"></i>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</section>
<!--=================================
Contact Us -->
</div>
</div>
</div>
评论