"Utilizing the Bootstrap 4 break tag with the justify-content-center class for centered

I'm currently working on creating something similar to this website, where I want to position my text in the center both vertically and horizontally. However, when using a <br> tag, it doesn't seem to work as expected.

<div class="container h-100">
    <div class="row h-100 justify-content-center align-items-center">
        <h1 style="font-size:4vw;" class="display-3"><b>Some text</b></h1><br>
        <h1 style="font-size:5vw;" class="display-3">{{key_words}} !</h1><br>
        <h1 style="font-size:4vw;" class="display-3"><b>Some other texts</b></h1>
    </div>
</div>

The text is appearing all in one line. Additionally, I'm looking for ways to add styling to the key_words such as animating their appearance. My goal is to achieve this with Bootstrap 4.

Answer №1

Avoid using a row, opt for a column instead and eliminate the need for break tags.

<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta.2/css/bootstrap.css" rel="stylesheet" />
<div class="container h-100">
  <div class="col h-100 justify-content-center align-items-center">
    <h1 style="font-size:4vw;" class="display-3"><b>Some text</b></h1>
    <h1 style="font-size:5vw;" class="display-3>{{key_words}} !</h1>
    <h1 style="font-size:4vw;" class="display-3"><b>Some other texts</b></h1>
  </div>
</div>

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

Trouble with line breaks in expandable rows of data grid causing clarity issues

Exploring the expandable rows feature of Clarity datagrid for the first time. I initially thought I could insert any HTML code within the collapsed view to show content. Using VMware's expandable datagrid: However, I am facing an issue where even wh ...

dual slider controls on a single webpage

I am attempting to place two different sliders on the same page. When I implement the following code for one slider, it functions correctly: <h3>Strength of Belief</h3> <div class="slidecontainer"> <div class="slider_left"> < ...

Tips on how to adjust the HTML5 input type attribute in ios 5 to display the current date and time

I attempted the solution that seemed most straightforward, but unfortunately it didn't yield the desired outcome... const element = document.getElementById("element-id"); element.value = new Date().toString(); The code requires a string input, but h ...

Breaking apart a pipe-separated text and sending it through a JavaScript function

CSS: <div class="pageEdit" value="Update|1234567|CLOTHES=5678~-9876543?|5678"> <a href="https://host:controller">Update</a> </div> Trying to retrieve the data within the div and pass it into a JavaScr ...

Interactive pop-up messages created with CSS and JavaScript that appear and fade based on the URL query string

I have a referral form on this page that I want people to use repeatedly. After submitting the form, it reloads the page with the query string ?referralsent=true so users can refer more people through the form. However, I also want to show users a confir ...

Printing HTML to a VueJS page is simple and efficient

I have a situation where one of my attributes in a property contains an HTML string. Instead of rendering the HTML as expected, when I output it within my template, the browser displays the raw HTML code with tags intact. It doesn't interpret it as a ...

The product has been taken out of the cart, yet it has not been reinserted into the cart

The product disappears from the cart after clicking on Add to Cart, but it doesn't reappear when clicked again. //function for adding only one item to cart document.getElementById('btn1').onclick = function() { addItemToCart() }; fun ...

Styling and structuring your website with CSS and HTML

I am coding an HTML page where I've incorporated CSS for the styling. However, I'm facing an issue with the drop-down menu. Whenever I try to click on a drop-down option, it disappears. How can I fix this? I want the drop-down options to be clic ...

Creating a customizable drop-down menu in PHP

I need help creating a dropdown list that populates with the options from a database table. $qry3 = "SELECT * FROM employees WHERE buss_id_fk = '{$_SESSION ['user_id']}' "; $result3 = mysqli_query ( $con, $qry3); while ($r ...

Utilize the grid system from Bootstrap to style HTML div elements

I am working on my angular application and need help with styling items in a Bootstrap grid based on the number of elements in an array. Here's what I'm looking to achieve: If there are 5 items in the array, I want to display the first two items ...

Using percentages to position Div elements

Currently, I am working on an HTML page that requires a div element spanning the full width of the page. My goal is to arrange other divs within this full-width div using percentages rather than pixels. The class associated with this div is .question. Thi ...

CSS code that fixes a textarea at the bottom of a div

I need help placing a textarea at the bottom of a fixed div: <div id=msg> <div id=content> aaaaaaaannnnnnnnnn<br> aaaaaaaannnnnnnnnn<br> aaaaaaaannnnnnnnnn<br> </div> <div id=text> <textar ...

How can I ensure that my Bootstrap 4 column adjusts to its content appropriately?

In the following container, there are two rows: the first row serves as the header, and the second row contains a left navigation bar and main content on the right side. The left nav bar is designed to shrink to the width of the content. By pressing a tog ...

Injecting a variety of wallpapers dynamically using css and html

As a beginner in CSS, HTML, and coding in general, I am currently working on creating my own start page with a local path that loads my bookmarks using an HTML file. The background-image control is handled by the style.css file. I have researched ways to c ...

Most effective strategy for optimizing web font loading considering caching and load speeds

When it comes to embedding fonts in your web app, there are a few different methods you can use. Method A) One way is to utilize the Google Fonts CDN by inserting this code into your HTML: <link href="https://fonts.googleapis.com/css2?family=Roboto:wg ...

Testing out various Xpaths but none seemed to be effective

I am trying to extract a score from the following URLs: shows a score of "10" displayed in an Octagon image, while has a score of "5". Upon inspecting the elements, I found the score represented as: <text y="100" dy="0.32em">& ...

Tips for seamlessly transitioning the background of Google Maps into view as you scroll down the page

I have a unique background with a Google Map. It loads perfectly in the right place when I open the page, but as I scroll down, it disappears from view. Is there a way to keep the Google map constantly in the background, even when scrolling? This is my cu ...

If the user is found in the database, show all form fields; otherwise, display them as read-only

My HTML form contains two buttons: "Search" and "Update". When the "Search" button is clicked, the code below retrieves values from a MySQL database. The retrieved value for "age" can then be inserted into the database using the "Update" button. The HTML ...

Checkbox fails to trigger onChange when the checked value is controlled by state management

Currently, I am working with a material-ui Table and have been in the process of implementing multi-select functionality on it. The behavior I am aiming for my multi select to exhibit is as follows: Checkboxes should only appear at the beginning of a ro ...

Having trouble replacing scss variables in react-h5-audio-player

I recently integrated react-h5-audio-player into my project and followed the instructions on the README page to customize the styles by updating the SCSS variables that control the colors. However, it appears that my custom styles are not being applied. An ...