tips for ensuring content is aligned at the bottom of the line

Struggling to align the content of two columns in a row at the same height? You're not alone!

Here is the HTML and CSS code snippet using Bootstrap 5:

 <div class="row">
  <div class="col-md-2" style="border: 1px solid; border-color: #FFFFFF;">
   <i class="fas fa-mobile-alt fa-2x" style="color: #FFFFFF;"></i>
  </div>
  <div class="col-md-10" style="border: 1px solid; border-color: #FFFFFF;">
   <span class="p-phone">Telefono e fax: +39 123456789</span>
  </div>
 </div><!-- end row -->

The "p-phone" class defined as:

.p-phone{
  color: #FFFFFF;
  font-weight: bold;
  font-size: 1.5rem;
}

Looking for assistance to align the content in the columns evenly?

Check out the updated jsfiddle link for more information:

https://jsfiddle.net/davidep/fwcudq0y/3/

The goal is to have the content inside both columns aligned at the same height.

Answer №1

insert the class align-items-baseline to the row div

alternatively, apply the style below to the row

.row {
   align-items: baseline;
}

Answer №2

Hello Davide, When it comes to HTML code, there are various ways to arrange text on a page. For example, you can use the tab symbol (&#9) to create a tabbed layout. Another option is to use the "p" tag to create paragraphs - these are commonly seen in visual media as blocks of text separated by blank lines or indentation. However, in HTML, paragraphs can encompass any related content like images or form fields. Best regards, Ori

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

What is the best way to position my Jchartfx area graph below my gridview?

When my page loads, the graph appears like this. It consistently shows up in the top left corner even though it should be positioned underneath the grid view as intended. var chart1; function createGraph(mpy) { if (mpy == undefined) mpy = 12.00; ch ...

Adjust the color of the input range slider using javascript

Is there a way to modify the color of my slider using <input type="range" id="input"> I attempted changing it with color, background-color, and bg-color but none seem to work... UPDATE: I am looking to alter it with javascript. Maybe something al ...

Utilizing the retina pixel ratio media query in Internet Explorer 8

I'm currently working on a project to develop a responsive website using SASS/Compass, and I am incorporating retina icons by utilizing generated sprites. In my .scss file, I have created a mixin for including these icons. Here is my mixin for retina ...

Tablet-friendly dropdown menu

Seeking advice on implementing @media queries for tablets with a width of 991px. Currently, the CSS file is optimized for mobile devices but needs adjustments for tablet responsiveness in the dropdown menu. I attempted the following CSS code: @media (max ...

URL displays the bootstrap carousel slider item's ID

The URL displays the ID of each slide on the bootstrap carousel slider, as shown in the images below: https://i.sstatic.net/TWcx2.png https://i.sstatic.net/xaJxm.png When changing sliders, the URL reflects the ID of each slide. After upgrading to a newe ...

Creating a tab resizing effect similar to Chrome using only CSS

I am attempting to design tabs that can dynamically resize similar to how Chrome tabs behave. However, I am uncertain if achieving this functionality is possible without relying on JavaScript. Browser compatibility is not a concern for me; my main goal is ...

HTML and Javascript Form Integration for Sage Pay Purchase Button

Currently, I am working on a project that includes online payment options via PayPal and Google Wallet, with a "buy now" button. Now, my next step is to incorporate the Sage Pay "buy now" button onto the website using HTML and JavaScript. Although I have ...

Capture any clicks that fall outside of the specified set

I am facing an issue with my navigation drop down menu. Currently, the pure CSS functionality requires users to click the link again to close the sub-menu. What I want is for the sub-menu to close whenever a click occurs outside of it. I attempted a solu ...

Sending information from a dynamic table to a database using PHP

I've created an HTML webpage with a table that fetches data from my database. Each row in the table has a button that, when clicked, dynamically adds the data into another table on the webpage using JavaScript. The dynamic table includes a submit butt ...

Is there a way to assign a unique scrollTop value for a specific scrollspy location?

I have a custom script that tracks the current position within a menu and applies an active class to it. However, I require specific rules for the ID contact_form. Specifically, I need to add 1000px to the scrollTop value for that particular ID location. ...

Align boxes in the center within a DIV container

Here is the box design that I have created: https://i.sstatic.net/3rtcn.jpg The green color boxes are generated dynamically inside a "col-md-10" div. If there are less than 3 boxes in the second row, I would like to center align them. For example, in thi ...

"Triggering an event after selecting and opening a file with an input of type file

Check out this snippet of HTML code: <input type="file" id="mysignature_upload" onChange="readURL();"/> We also have some Javascript code: function readURL(){ alert("Hello"); } A potential issue with this code is that the function readURL is on ...

I am seeing the number 1 mysteriously popping up on my HTML page without my intervention

Working on a website design, I encountered an issue with my HTML code. When executing and displaying content from a PHP file on the page, a strange number 1 is added after parsing the PHP file's content. Here is the snippet of HTML and PHP causing th ...

Discover the power of using SVG sprites in Vue JS for dynamic, visually appealing CSS background

Utilizing an SVG sprite file in a Vue JS HTML template is successful with the following setup: <svg class="icon"> <use xlink:href="~@/assets/images/icons.svg#edit"></use> </svg> The contents of the icons.svg file typically resem ...

Tips for displaying cards with responsive design utilizing Bootstrap 5

How can I display cards responsively for mobile, desktop, and iPad? My goal is to have: - One column for mobile - Two columns for iPad - Four columns for desktop The current code only works for mobile and desktop, not for iPad. On my iPad, it's sh ...

A guide on accessing the href attribute of an HTML tag using jQuery

My goal is to extract the ID from the href attribute of an a tag on my webpage. First, I need to prevent the page from refreshing before performing this task. The example a tags look like this: '<a href="/ArtPlaces/Delete/5">Delete</a>&ap ...

Enhance your table with custom styling by incorporating the seanmacisaac table and placing the tbody within a div

I am looking to make adjustments to a Jquery sortable, searchable table created by seanmacisaac. For more information, visit the link: Does anyone know how to set the height of the tbody to a fixed value while allowing vertical scrolling (overflow-y)? & ...

The droplist functionality in jQuery does not seem to be functioning properly within an ASP.NET MVC 5

After adding an external theme to my project and writing a script for listing data in a dropdown list on a separate page, I encountered an issue where the script works on other pages but not on the Layout theme page. HomeController Note: The partial view ...

Notification window when the page is being loaded

My goal is to have a module or alert box display when my website is opened, and then disappear after 5 minutes. To see an example of what I'm looking for, take a look at this website: On that website, there is a facebook.com box that automatically d ...

Frequently Asked Questions about Bootstrap Navbars

I designed my NavBar to look a certain way, but I have some inquiries regarding it. https://i.sstatic.net/4nypZ.png This is the code for NavMenu.razor: <nav class="navbar navbar-expand-md navbar-dark bg-dark mb-4"> <div class=" ...