Guide on making a two-column <ul> list with Font Awesome icons as bullets using Bootstrap 4

I've been struggling with the "Hobbies and Interests" section of my project. Here is a screenshot for reference: https://i.sstatic.net/ZjShg.png. The issue lies in the unordered list where font awesome icons are used as bullets. I aim to divide it into two columns while ensuring responsiveness, meaning the gap between the columns adjusts smoothly and the icons and text stay intact without wrapping onto new lines as they currently do.


                <section id= "skills">

                    <h3 class="text-center pt-3 pb-3"><strong> Ready to tackle any challenge. Proven by performance.</strong></h3>
                    <div class="container containerPadding">
                        <div class="row">
                            <div class="col-sm-4 ">

                                <!--- Instruments -->

</div>
                            <div class="col-sm-6 offset-sm-2 ">

                                <div class="container float-center">
                                    <h1 class="text-center pt-5 ez-animate" data-animation="bounce"><strong>Hobbies and Interests</strong></h1>
                                    <div class="row">
                                        <div class="col" style="column-count: 2; column-gap: 15em;">
                                            <ul class="barbie list-unstyled">
                                                <li class= "barbieitem pb-2 pt-2 puzzle text-left ">Puzzles</li>
                                                <li class= "barbieitem pb-2 pr-4 plane text-left">Travel</li>
                                                <li class= "barbieitem pb-2 wrench text-left">Handy Work</li>
                                                <li class= "barbieitem pb-2 plane text-left">Travel</li>
                                                <li class= "barbieitem pb-2 volunteer text-left">Volunteering</li>
                                                <li class= "barbieitem pb-2 car text-left">Automobiles</li>
                                                <li class= "barbieitem pb-2 plane text-left">Travel</li>
                                                <li class= "barbieitem pb-2 camera text-left">Photography</li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
            </section>
      

CSS:


     dt {font-size: 1.3em;position:relative;}
     dt:not(:first-of-type) {margin-top: 2em}

     dt:before {
        content: ""; 
        font-family: FontAwesome;
        left: -40px;
        // position:absolute;
        top: 5px;
        display: inline-block;
        margin-right: 8px;
    }

    dt.achievement:before {
        content: "\f091"; 
        -webkit-animation: fa-spin 2s infinite linear;
        animation: fa-spin 2s infinite linear;
    }
   
    /* Rest of CSS code remains unchanged for functionality */

Answer №1

There seems to be an issue with the text/icon wrapping due to a fixed width of 15 characters in the current font. The column-gap rule you have set is causing the rest of the div to reflow around it. To achieve the desired result, consider adjusting or removing the column-gap property.

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 extract this content from the HTML using Selenium Webdriver?

My goal is to extract the text "1532.6788418669355" from this HTML code, but I've been facing challenges in doing so. Here's what I've attempted: IList options = Driver.FindElements(By.XPath(".//span//*")); Options[0].Text = "" There are n ...

Is there a way to alter the color of an item just by clicking on it?

Looking to enhance my programming skills, I am interested in changing the color of an item to a series of colors upon clicking. I am weighing the options between CSS, javascript, and JQuery to achieve this effect. Which approach would be the most optimal ...

Hover effect not displaying upon mouse exit

I am working on a feature where a series of images change when hovered over, with a div animating as an overlay on the image. Here is the code snippet: // hiding overlays initially $(".mini-shop .item .image a div").hide(); // toggling overlay and second ...

Retrieve the text located in a specific row and column

I'm experiencing an issue where I am only receiving the entire row as an object, but what I actually need is the data from the second column in that row. $('#table_id tbody').on('click', 'tr', function (e) { var ...

Is it possible to integrate a GWT library into Dart programming?

Considering migrating to Dart, but unsure of its maturity. Can a library originally written in GWT be used in Dart? ...

Get the value of an HTML element

Is there a way to retrieve the value of an HTML element using PHP or JavaScript, especially when the value is dynamically loaded from another source? I have tried using jQuery with the DOM ready event, but often encounter the issue where the element's ...

Expanding the input focus to include the icon, allowing it to be clicked

Having trouble with my date picker component (v-date-picker) where I can't seem to get the icon, a Font Awesome Icon separate from the date-picker, to open the calendar on focus when clicked. I've attempted some solutions mentioned in this resour ...

Is there a way to merge two :not() selectors together?

Attempting to achieve the following: :not(h1) > a, :not(figure) > a { background: #859900; } Encountering an issue as figure>a is matching with :not(h1)>a, and h1>a is matching with :not(figure)>a. How can I merge these selectors? ...

Implementing a Function Triggered by Clicking Text in Angular 8

Is there a way to create an HTML anchor tag with a click event that triggers a function without causing the page to reload or refresh? <div *ngIf="showOTPResendText"> <p style="text-align: center;">Please wait {{counte ...

What is the best way to conceal components in a GUI immediately following the execution of the JavaFX container class?

One of the Java Projects involves creating a cash register using JavaFX. To view the GUI image, simply click here. The program presented in the GUI will prompt users to input the number of items purchased, the amount paid, and display the change due in a ...

Error in Typescript: The type 'Element' does not have a property named 'contains'

Hey there, I'm currently listening for a focus event on an HTML dialog and attempting to validate if the currently focused element is part of my "dialog" class. Check out the code snippet below: $(document).ready(() => { document.addEventListe ...

Creating custom CSS for Styled Components in ReactJS

I'm struggling with CSS in React using styled components. Below is the code snippet I am working with: import React from 'react'; import { Navbar, Container, Row, Col } from 'reactstrap'; import styled from 'styled-components& ...

ensure that pagination is optimized for mobile viewing in Laravel using Bootstrap

I am facing an issue with fitting the pagination on a mobile device using Laravel 6 and Bootstrap 4. After some research, I discovered a useful function for pagination called onEachSide(). $products->onEachSide(1)->links() Initially, everything l ...

CSS hack for older versions of Internet Explorer (ie6, ie7, and ie8)

Is there a way to selectively hide a single line of CSS from Internet Explorer 6, 7, and 8 so that they do not display that line? I am looking for a method to conceal the start and end of a media query specifically for those browsers so that they only see ...

Expanding Viewports with Dynamic Scrolling Bootstrap Columns

Striving to achieve a specific design in Bootstrap, but hitting roadblocks. The criteria are as follows: No scrolling in the browser window. Display occupying 100% of browser height. Columns for Menu, Left contents, and Right contents must scroll indepen ...

Issue displaying image on iPhone screens due to html rendering error

I have encountered a glitch in the website I am working on. In a regular grid layout of projects, fragments of images are overlapping other HTML image containers nearby, with unpredictable behavior when scrolling or zooming. This issue only occurs on cer ...

Learn how to change the icon in Vuejs when the class 'active' is present

I have a bottom navigation bar with icons. How can I make it so that when the router-link has the class 'active', the icon associated with it also becomes active? By default, the first icon is active. <li> <router-link v-if="ac ...

How to perfectly center an image vertically within a div using CSS

Seeking assistance to properly align images of different sizes in the center of a container div. Check out the attached image for reference, showcasing the gray background and the desired alignment of images in the middle. https://i.sstatic.net/M16V1.png ...

How can I create a loop to iterate through form/input files with varying titles?

Looping through input files with different titles Hello, I am trying to figure out how to loop through an input file with different titles. Each input file has a unique title, such as Safety Data Sheet, Certificate, etc. This is my current code: $titles ...

Extracting data from XML using my custom script

I attempted to extract a specific value from an XML feed, but encountered some difficulties. In addition to the existing functionality that is working fine, I want to retrieve the value of "StartTime" as well. Here is the relevant section of the XML: < ...