Wrapping text in Bootstrap 4 containers for better readability

I am attempting to wrap the title text around a span object. So far, I have been successful in getting everything aligned correctly, but the final step of wrapping the text seems challenging. My suspicion is that the issue lies in the separation of containers; removing the container disrupts the formatting,

<div class="row px-3">
  <div class="jumbotron">
    <span class="float-right d-flex ">
      <div class="align-self-center mr-1">Submitted by</div>
      <div class="btn-group">
        <button class="btn">User</button>
        <button class="btn btn-info"></button>
        <button class="btn btn-danger"></button>
     </div>
   </span>
   <h1 class="d-flex">
     <div id="title">A lengthy post title to test wrapping functionality</div>
   </h1>
   <div id="body">a brief body text below the title</div>
  </div>
</div>

Here is the example code on JSFiddle

Utilizing Bootstrap 4 as indicated by the title. Any suggestions or advice would be greatly appreciated...

Answer №1

It seems like the issue lies in your incorrect usage of tags.

The element div is not allowed as a child of span/h1 in this context.

Take a look at this fiddle link, it should help resolve your problem: Fiddle

<div class="row px-3">
    <div class="jumbotron">
        <div class="float-right">
            <div class="">Submitted by
            </div>
            <div class="btn-group">
                <button class="btn">User</button>
                <button class="btn btn-info"></button>
                <button class="btn btn-danger"></button>
            </div>
        </div>
    <p id="editor-title">A very long post title that needs to be long enough to see if the wrapping is working or not sdjfs dakjsd askjdhas dkjashd asdjkhasd askjdhas dasjdasdkjasd asdkjhasd djkf dfuieywrbewrgew weruwe</p>
    <div id= "editor-body">a short body underneath the title</div>
    </div>
</div>

I recommend using the W3C HTML checker for future projects.

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

Intermittent rendering problems in Chrome due to CSS printing with a fixed header and footer

I am attempting to customize the format of an e-commerce receipt for printing, including a fixed header and footer that will appear on every printed page. However, I am encountering intermittent issues. Sometimes, the layout works correctly, while other ti ...

Unable to locate a selenium-recognized element within this field

I've attempted to use FindElementByName but I keep getting a no such element error when it should recognize this name. What am I overlooking? This issue is occurring on the website Intacct.com. Despite my efforts, I have been unable to find a unique C ...

Vertical centering not functioning as expected due to issues with margin-top and margin-bottom

I'm having trouble centering my red block in the middle of the webpage, with the footer block at the bottom and the white block between them. Oddly enough, margin-top doesn't seem to be working for me, but left and right are functioning fine. Al ...

Problems encountered when applying box-shadow for text background across multiple lines

Lately, I've become accustomed to using box-shadow to add backgrounds to text headings. I've been employing a little trick of applying a box-shadow to a span element within h1 tags in order to create a unique "background with padding" highlight e ...

Master the Art of Image Loading in Codeigniter

Hey there, I'm completely new to Codeigniter. In the Controllers folder, I've created a file called caller.php and in the \Views directory, I've created a file named home1.php. Additionally, within the root directory, I've made an ...

Upon selecting the checkbox, the user will be redirected to an input textbox

Can I make it so that when I check a checkbox, it automatically directs me to a textbox as if I pressed the TAB key? Is there a way to achieve this using only HTML and CSS? ...

Arranging numerous Text elements within a solitary Drag and Drop container with the z-index property

I am facing a challenge with stacking twelve arguments in no particular order on a drag and drop element. The texts overlap each other, making it difficult for the end user to see them clearly when dragging and dropping. Is there a way to stack texts using ...

What is the best way to create a row with five columns using Jumbotron Bootstrap?

I found my reference at this address: This is how my script looks like: <b-row> <b-col cols> <b-jumbotron header="Bootstrap 4" lead="Bootstrap 4 Components for Vue.js 2"> <p>For more information, please visit the websi ...

Ways to update the angular content following a switch in the current bootstrap tab?

My component displays multiple tabs, with only one active depending on the business logic. Here is a snippet of the code: <ul class="nav nav-tabs"> <li *ngIf="activateTab1" class="active"><a data-toggle="tab" href="#tab1"> < ...

Accordion content in motion

After creating an accordion, I wanted to enhance the user experience by adding a transition effect whenever they click on the accordion header. Even though I included height: auto and transition in the accordion container, it did not seem to have any impa ...

How can I ensure a div always moves to the right by using margin-right auto?

How can I align a div to the right using margin-right auto? I attempted margin-right: auto; and margin: 0 0 0 auto; but it was not successful. ...

Creating a text-only fadein/fadeout carousel using JavaScript with a similar functionality to Bootstrap

Is there a way to create a fade-in/fade-out text only carousel similar to the one on the header of this website using just a few lines of CSS and Javascript instead of including the whole Bootstrap framework? I examined the code of the website and it appe ...

What could be causing my CSS code to not function properly within Vue.js?

Having trouble with css in VueJs. I can't seem to figure out what I'm doing wrong. Generally, my scoped style css works fine in vuejs, I can target ids and classes without any issues. The problem arises when trying to change the internal css va ...

Icons disappear from the navbar toggle when clicked on a small screen

Using Django and Bootstrap 4, I've created a navbar with a toggle feature. However, when viewed on a small screen, the toggle button does not display the icons as expected. Instead, it shows empty lines. Strangely, when the phone is rotated, the toggl ...

Updating contact list to a database table structure

Currently, my code displays the data in address books, but I would like it to be shown in a table instead. I attempted to use document.write to create the table, but I'm unsure how to populate the table with the data rather than the address book forma ...

Is there a way to use HTML and CSS to switch the style of a dynamic decimal number to either Roman numerals or Katakana characters within a specified HTML element, such as a tag, div

I've searched everywhere but only found guides on list styling and counter styling in CSS that didn't work out. So, for example, I have a number inside an HTML tag that is changed dynamically using Vue Watch. I want to display the number in upper ...

What is the process of adjusting frame alignment?

How can I arrange my frames in HTML according to the diagram below? What is the process for creating rows within frame-set columns? Is CSS necessary for this task? <html> <frameset cols="25%,*"> <frame src="myframe1.htm"> <frame s ...

What is the best way to enforce a left alignment for a menu?

I am looking to align the titles on the left side. I suspect that the issue lies in this particular line of code. Can someone help me identify which properties I should adjust to resolve this problem? https://i.sstatic.net/XWCsd.png Interestingly, the ic ...

Adding padding with and without child elements

As I work on styling a basic menu, I'm struggling to find a solution for adding padding to list items so they all have a consistent look. The challenge arises from the fact that I have an unordered list where list items may or may not contain an anch ...

What is the best method for dynamically loading CSS using JavaScript?

Due to a certain condition I have, I am unable to load some CSS and JS in my HTML. As a solution, I've decided to dynamically pull them using $.get(). While I have successfully tested pulling and executing js remotely, I am facing some challenges when ...