Guide to Using Bootstrap 4 for User Information: Best Practices and Steps to Follow

I'm currently working on a design layout using bootstrap 4 alpha version and I must say, the cards feature is quite impressive.

Specifically, I have this section within the layout where I want to align the phone number and email address info on the same line. Now, I wouldn't call myself a CSS expert by any means, but I know enough to get myself in trouble. So, I'm a bit unsure on how to go about achieving this effect correctly. Any advice or tips would be greatly appreciated.

Below is the code snippet that I'm currently working with:


      <div class="media">
              <div class="media-left">
                <a href="#">
                  <img class="media-object" src="img/avatars/adelle.jpg" alt="Generic placeholder image">
                </a>
              </div>
              <div class="media-body">
                <span class="favorite"><a href="#"><i class="fa fa-star"></i></a></span>
                  <h6 class="media-heading">Jacqueline Perry</h6>
                  <span class="company">Domino Technologies</span>
                    <div class="row">
                      <div class="col-xs-12 col-sm-6 col-md-8">
                        <ul class="details">
                          <li class="phone"><i class="fa fa-mobile fa-lg fa-lg"></i> (123) 786-4533 </li>
                          <li class="email"><a href="#"><i class="fa fa-paper-plane-o"></i> <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1e747f7d6f6b7b7277707b306e7b6c6c675e6d737776707d75707678767b7377787b60757075">[email protected]</a></a></li>
                          <li class="address"><i class="fa fa-map-marker"></i> 338 West 23rd Street New York, NY 10011, USA </li>
                        </ul>
                      </div>
                    </div> <!-- ./row -->
              </div> 
            </div>
    
  

The goal here is to achieve something like the example shown in the image below:

https://i.sstatic.net/akDpx.png

Answer №1

http://jsfiddle.net/hamzanisar/d1mdm2tk/3

Give this a try and see if it fits your needs. Adjusting the viewport size will make it responsive with one line, and you can customize it further by using row and col-*-*. This method eliminates the need for additional custom CSS styling.

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

Adding an information panel to each column in jqgrid allows the grid to display a scrolling feature

We have implemented a jQuery grid where the last column contains a link. When this link is clicked, a new panel should appear providing additional information. To achieve this, we utilized a formatter that generates a hidden div along with the link. Howev ...

Electron does not prioritize the @css prefers-color-scheme option

I recently completed an Electron project and decided to incorporate dark mode support into it. However, for some reason, the dark mode feature is not functioning properly. Below you will find the dark.css styling that I have included in every page: @medi ...

What is the best way to only load a specific div from another webpage onto my own webpage without loading the entire page?

I am currently working with two webpages named internal.html and external.html Within internal.html, I have the following code snippet that loads external.html into a div with the id "result": <script src="http://ajax.googleapis.com/ajax/libs/jquer ...

Toggle visibility of a div with bootstrap checkbox - enforce input requirements only if checkbox is marked

Lately, I've been facing a strange issue with using a checkbox that collapses a hidden div by utilizing bootstrap. When I include the attribute data-toggle="collapse" in the checkbox input section, the div collapses but it mandates every single one o ...

Incorporate personalized design elements within the popup component of Material-UI's DataGrid Toolbar

I am in the process of customizing a Data Grid Toolbar component by making adjustments to the existing Grid Toolbar components sourced from Material-UI. For reference, you can view the official example of the Grid Toolbar components here. Upon clicking o ...

How about applying the transition property to the universal selector?

Will using *{ transition: all 0.25s linear; } negatively impact performance or is it considered a bad practice? Are there alternative methods to achieve smoother transitions for elements? I aim to create seamless transitions for elements without any abrup ...

Here are the steps to input keys into an element such as `<textarea name="body" placeholder="Start typing...`

Presented below is an element: <textarea name="body" placeholder="Start typing..." tabindex="0" pwa2-uuid="EDITOR-C10-C4D-8CC58-82F" pwa-fake-editor="" spellcheck="false" style="white-spac ...

Unraveling a Java String with HTML elements into a JsonObject: Step-by-step Guide

Hey there, I have a Java String that was received from an HTTP request and it looks like this: {SubRefNumber:"3243 ",QBType:"-----",Question:"<p><img title="format.jpg" src="data:image/jpeg;base64,/9j/4AAQSkZJRgAB..."></img></p>"} ...

Utilizing div tags for creating backgrounds in HTML

I am currently in the process of developing a website and would like to incorporate particles.js as my background while overlaying the content. However, I'm facing an issue where the content is displaying on top of the page instead of behind it when I ...

The HTML document is having trouble establishing a connection with socketio

I currently hold an HTML file within my local file system, presented as follows: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Example of a Minimal Working File</title> ...

Having trouble displaying all 6 columns in the Bootstrap carousel - only 3 columns are showing up

I came across this inspiring Codepen and decided to tweak it to support Bootstrap's col-md-2 class. Despite my efforts, only 3 columns are showing up. I suspect that neighboring cards of the active card receive additional classes for display purposes ...

Using Javascript to populate textboxes with the value of checkboxes

Within my web application, there is a series of checkboxes that, when selected, populate a textbox located above them. If more than one checkbox is checked, their values are displayed in the textbox separated by commas. These checkboxes are structured as ...

Tips for altering symbol hues in Angular 4 pipelines

Can the color of the Angular 4 pipes symbol be customized? I am looking to change the dollar symbol to a lighter color, for instance. Link to Image The price shown is formatted using the currency pipe: currency:'USD':'symbol-narrow': ...

Tips for keeping buttons anchored at the bottom of the page during scrolling

As a newcomer to Ionic, HTML, and CSS, I am currently exploring how to keep a button fixed while scrolling through the page. Despite specifying a fixed position in the CSS, the button does not remain fixed as intended. The button seems to be having troubl ...

Remove dynamically inserted list item using a button

I have dynamically created an unordered list (<ul>) that adds list items (<li>) when a button is clicked, along with a remove button. Initially, the default list item should not contain a remove button so I added it in the script. SCRIPT $(d ...

What could be the reason that I am unable to absolutely position generated content in Firefox?

I am currently designing a horizontal navigation bar and here is the CSS I have used: #topnav { clear: both; overflow: hidden; display: table; } #topnav ul { display: table-row; } #topnav ul li { display: table-cell; vertical-ali ...

Are there any open source libraries in jQuery or HTML that can be used for creating av

I have been searching extensively for an open source avatar library that can perform basic functions like choosing gender, eyes, and clothing. It was surprising to me that I couldn't find any open source framework for avatars on the web, especially c ...

What is the best way to disable a JavaScript code based on a specific screen width?

When I click on a specific link, it triggers an alert using jQuery. Here is the HTML code for the link: <a class="link" href="www.example.com">link</a> The JavaScript code attached to the link is as follows: $(".link").click(function() { ...

(Material UI version 5) Custom global style enhancements

One of the examples in MUI is the Global style overrides: const theme = createTheme({ components: { // Name of the component MuiButton: { styleOverrides: { // Name of the slot root: { // Some CSS fontSize ...

Revolutionary scroll-based navigation fill transition

I'm attempting to achieve an effect where the fill color of the "insticon" SVG changes from black to white based on the scroll position indicated in the jQuery code. I have made the necessary modifications in the if and else statements, but unlike "he ...