In a mesmerizing display, text cascades from the confines of a Bootstrap

I'm attempting to position two words on the left and right sides of a Bootstrap 4 card...

However, I am encountering an issue where: https://i.sstatic.net/jPgif.jpg

The text "Choro" is overflowing out of the card body...

Here is my code:

<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags always 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, then 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: all 0.2s ease-in-out;
 }

What am I doing wrong? even putting another container tag inside card doesn't work

EDIT

It now looks like this: https://i.sstatic.net/F298y.jpg Thank You @G.L.P

Answer №1

If you want to make some changes to your HTML structure, consider following this example: See Demo

Simply insert card-block after the 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>

Note: .dl-horizontal currently has negative margin values for left and right, so you may need to update it like this: View Demo

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

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is it possible for me to clear the content of the previous page before the page above it slides

Using the ons-sliding-menu component from Onsen UI, I have encountered an issue. When clicking on a menu item in the behind-page, the above-page slides in but still displays the previous content for a brief moment (although very short, it is noticeable). ...

Mastering the art of passing props between components in React

I am striving to leverage data from a JSON file to pass specific information using props in React, with the aim of loading multiple images (cards). This project involves three key components: App, MainCard, and a JSON file named Data. I am facing challen ...

The MUI component with hideBackDrop={true} is preventing me from clicking outside of the Drawer component to close it

I implemented a Drawer component which opens when an icon on the Map is clicked. The drawer menu appears along with a backshadow that drops over the map. Interestingly, clicking on the map while the backshadow is displayed closes the drawer without any i ...

Instructions for loading static HTML content in the browser from a specific directory

Exploring my file hierarchy: public---| |-index.html |-static-| |-static.html After launching the project at localhost:4000, it directs to the public folder and displays index.html. However, I am looking to load static ...

Change an image seamlessly without any flickering, and display the new one instantaneously

TL;DR: How can images be swapped smoothly without causing page flicker while indicating loading status? I am facing an issue with swapping between 2 images using buttons. The first image loads fine, but the second image doesn't display until it' ...

Refresh all color pickers with Bootstrap 4 Colorpicker - enforce the update of every color selector

Currently, I am utilizing the Bootstrap 4 color picker library which can be found at this link: In my code, I have defined color pickers that look like this: <div class="input-group cpicker"> <input type="text" class="form-control input-lg" ...

Several adhesive panels on a dynamic webpage

In the content area of my page, a dynamic number of rows are generated. Each row consists of two columns: a side block and a content area. The goal is to have the side block stick while the page scrolls down until the next block appears and pushes the prev ...

Enabling HTML elements in a postback operation

In my user interface, there is a text box where users can input text containing HTML markup. Whenever the page triggers a postback action, it results in an error (500) as the parser interprets the HTML code in the textbox as a hacking attempt. I vaguely ...

Guide on adding dual horizontal scroll bars to a v-data-table (Vue / vuetify)

Currently, I am working on Vue / Vuetify and experimenting with the v-data-table component. While creating a table, I noticed that it has a horizontal scroll bar at the bottom. https://i.stack.imgur.com/noOzN.png My goal now is to implement two horizontal ...

The issue with SVG icons: viewBox does not accurately scale the size

I have integrated Bootstrap with SVG icons from material.io at https://material.io/resources/icons/?style=baseline. However, I am facing an issue where the SVG icon does not scale up when I paste the code into my HTML page. Despite setting width="48" and h ...

Can you please provide guidance on implementing automatic horizontal scrolling with pauses between each div?

setInterval(function scroll() { $(".box_auto").each(function(i, e) { $("html, body").animate({ scrollTop: $(e).offset().top }, 500).delay(500); }); setTimeout(function() { $('html, body').animate({ scrollTop: 0 } ...

A simple demo showcasing interactive HTML pages using Django and AJAX

In my search for answers, I came across the following helpful posts: How to Reload table data in Django without refreshing the page Tutorial on Django dynamic HTML table refresh with AJAX Despite the insights from these posts, I am still facing chal ...

Unable to retrieve the chosen option from the datalist

I am encountering an issue with a datalist where I can't seem to retrieve the value that is currently selected when a button is clicked. Despite following recommendations from various posts on Stack Overflow, my code still returns undefined. Interesti ...

Modify the color of a sub division's background using CSS when hovering over

As I work on this Fiddle, my goal is to change the background of each div section individually when moused over. However, currently, hovering over one section triggers the background change for all sections. Is there a way to ensure that only the specific ...

While attempting to dynamically add styles to a stylesheet using JavaScript, an error message was encountered stating "Cannot read property 'length' of undefined"

I am currently developing a custom polyfill that enables older browsers like Internet Explorer to interpret and run media queries using traditional CSS selectors. The process is outlined as follows: Iterate through each stylesheet found in the document A ...

Exploring the world of three-dimensional graphics with the power of HTML5, canvas,

Here is the HTML markup I am working with: <canvas id="container" name ="container" width="300" height="300"></canvas> This is the JavaScript code: var WIDTH = 400, HEIGHT = 300; var VIEW_ANGLE = 90, ASPECT = WIDTH / HEIGHT, NEAR = 1, FAR = ...

The link button became unresponsive as soon as I implemented CSS changes

I customized one of my buttons with special styling, and now I'm facing an issue where the button is clickable but it fails to direct me to the intended link (which should open a YouTube video in a new tab). #help { background-color: cornflowerbl ...

best practices for choosing items from a dropdown menu using Angular

I have a dropdown list displaying existing tags/chips created by users in the past. However, I'm having an issue where when I select a tag from the dropdown list, it doesn't show up in my input field (similar to the Chart tag currently). I am abl ...

Center div encroaching on floated left div

https://i.sstatic.net/uwyGY.pngCan someone help me align three divs horizontally? I'm having an issue where the center div is overlapping the left div. What could be causing this problem? <div> <div style={{width:"100px", ...

sort jquery alphabetical characters

I have created some html and jQuery code that allows me to hide elements based on class name when I click on specific buttons in the filter div. However, I am now looking to add functionality to sort the elements alphabetically by class name when I press ...