html - text flows out of bootstrap 4 card -


i trying place 2 words on left , right side of bootstrap 4 card...

however problem : enter image description here

the text "choro" flows out of card body...

here code:

<!doctype html> <html lang="en"> <head> <!-- required meta tags come first --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta http-equiv="x-ua-compatible" content="ie=edge">  <!-- bootstrap css --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" integrity="sha384-y3tfxazxuh4hwsyylfb+j125mxis6mr5fohampbg064zb+afewh94ndvacbm8qnd" crossorigin="anonymous"> <link href="custom.css" rel="stylesheet"> </head> <body> <div class="align-middle"> <div class="container">             <div class="card card-1">                 <p class="card-text">                     <dl class="dl-horizontal">                   <dt class="col-md-10 col-md-push-"><h1>choro</h1></dt>                   <dd class="col-md-1"><h1>boy</h1></dd>                  </dl>                   </p>                             </div>             </div>             </div>              </div>  <!-- jquery first, bootstrap js. --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/js/bootstrap.min.js" integrity="sha384-vz2wrjmwsjrmw/8u7i6pwi6alo1l79snbrmgidpgiwj82z8ea5lenwvxbmv1pah7" crossorigin="anonymous"></script>  </body> </html> 

and custom.css code is:

.align-middle {     margin-top: 25px;     margin-bottom: 25px; }  .card-1 {     box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);    transition: 0.2s ease-in-out;  } 

what doing wrong? putting container tag inside card doesn't works

edit

it looks now: enter image description here thank @g.l.p

just few changes in html structure this: demo

you need add card-block after card div

 <div class="card-text">             <div class="card-block">              <dl class="dl-horizontal">             <dt class="col-md-10"><h1>choro</h1></dt>             <dd class="col-md-1">               <h1>boy</h1></dd>           </dl>         </div>       </div> 

edit: .dl-horizontal has margin-left & right in negative values, change class name / update this: demo

.dl-horizontal {     margin-right: 0rem;     margin-left: 0rem; } 

Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -