Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dl(detail list) not working in bootstrap 4

Tags:

dl list view not working in bootstrap 4 same as it does in bootstrap 3

HTML:

 <section class="landing">       <div class="container">         <dl class="dl-horizontal">           <dt>col1</dt>           <dd>col2</dd>         </dl>       </div>     </section> 
like image 666
cdTest Avatar asked Aug 26 '16 11:08

cdTest


People also ask

Which class creates a list of items in bootstrap 4?

Bootstrap list group is used to create a group of list with list items. The most basic list group is an unordered list containing list items. The class ". list-group" within the <ul> element and the class ".

What is list Group flush?

Add .list-group-flush to remove some borders and rounded corners to render list group items edge-to-edge in a parent container (e.g., cards).

How do I center an unordered list in bootstrap?

You need to use the class text-center which actually centers the block in the screen using the text-align property within bootstrap css. Hope this helps.

Why my bootstrap is not working?

These are the possible reasons: You have a wrong or incorrect link to the bootstrap file. browser caching and history is messing with your html. Other CSS files are overriding the bootstrap file.


2 Answers

I had the same exact problem and solved it using .row class as suggested by @Paulie_D

Here is what I did

 <section class="landing">   <div class="container">     <dl class="row">       <dt class="col-sm-3">col1</dt>       <dd class="col-sm-9">col2</dd>     </dl>   </div> </section> 

UPDATE You can also add text align right and left

 <section class="landing">   <div class="container">     <dl class="row">       <dt class="col-sm-3 text-right">col1</dt>       <dd class="col-sm-9 text-left">col2</dd>     </dl>   </div> </section> 
like image 63
Bellash Avatar answered Sep 25 '22 03:09

Bellash


That class has been removed from Bootstrap in V4.

From the Migration documents of Bootstrap 4

.dl-horizontal has been dropped. Instead, use .row on <dl> and use grid column classes (or mixins) on its <dt> and <dd> children.

like image 30
Paulie_D Avatar answered Sep 22 '22 03:09

Paulie_D