Arrange two icons side by side on the same line

How can I align two icons inside the "col" class in a horizontal line rather than stacked on top of each other? Additionally, I want to reorder them using the bootstrap "order" class. Can someone please assist me with this?

I've attempted wrapping them in an additional row and col, as well as using flex with flex-direction, but it hasn't worked.

In the footer

I'm looking to align two icons inside my .segment-six class.

The icons are currently one above the other, but I would like to see them horizontally aligned. Specifically, I want to reorder these elements so that .segment-four comes first, followed by .segment-six, and then .segment-five when stacked.

.segment-six {
  /* display: flex; 
   flex-direction: row; */
  width: 120px;
  /* margin-left:auto;
   margin-right: 20%; */
  img {
    max-width: 100%;
    max-height: 100%;
    /* padding-left: 50px; */
  }
}
<!-- Bootstrap -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

<div class="row">
  <div class="col-md-3 col-sm-12 col-xs-12 segment-four">
    <img src="https://via.placeholder.com/50">
  </div>
  <div class="col-md-3 col-sm-12 col-xs-12 segment-six">
    <a href="#"><img src="https://via.placeholder.com/100"></a>
    <a href="#"><img src="https://via.placeholder.com/150"></a>
  </div>
  <div class="col-md-6 col-sm-12 col-xs-12 segment-five">
    <p>©TOO SMART PAY ПЛАТЕЖНАЯ ОРГАНИЗАЦИЯ №02-17-012 OT 09.02.2017 РЕЕСТР НАЦИОНАЛЬНОГО БАНКА РК</p>
  </div>
</div>

Answer №1

insert the following code snippet into your CSS stylesheet

CSS Styling

.segment-six a{
    display: flex;
}
.segment-six a img{
    width: 100%;
    height: auto;
}

Answer №2

When utilizing bootstrap 4, it is recommended to use order instead of .segment.

For instance, you should use .order-5 rather than .segment-five.

If your items appear horizontally aligned, make sure to include the Bootstrap framework in your header:

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

.order-6 {
  /* display: flex; 
   flex-direction: row; */
  width: 120px;
  /* margin-left:auto;
   margin-right: 20%; */
  img {
    max-width: 100%;
    max-height: 100%;
    /* padding-left: 50px; */
  }
}
<!-- Bootstrap -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

<div class="row">
  <div class="col-md-3 col-sm-12 col-xs-12 order-4">
    <img src="https://dummyimage.com/100x100/888/fff.jpg&text=image+1">
  </div>
  <div class="col-md-3 col-sm-12 col-xs-12 order-6">
    <a href="#"><img src="https://dummyimage.com/100x100/888/fff.jpg&text=image+2"></a>
    <a href="#"><img src="https://dummyimage.com/100x100/888/fff.jpg&text=image+3"></a>
  </div>
  <div class="col-md-6 col-sm-12 col-xs-12 order-5">
    <p>©TOO SMART PAY ПЛАТЕЖНАЯ ОРГАНИЗАЦИЯ №02-17-012 OT 09.02.2017 РЕЕСТР НАЦИОНАЛЬНОГО БАНКА РК</p>
  </div>
</div>

To understand more about the order class, visit:
https://getbootstrap.com/docs/4.3/layout/grid/#order-classes

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

The behavior of the button type value varies between Internet Explorer and Firefox

Inside a form, I have a button with the following code: <form method="post" action=""> <button type=submit value="hello" name="submitform">World</button> </form> Interestingly, the behavior of this button type varies across differ ...

What is the best way to evenly space out divs filled with images in a horizontal layout?

On my website, the header consists of text and a logo. Since the font used is not standard, the text is displayed as an image. I am looking to create a design in which the elements of the site adjust according to the size of the browser window. Is this wh ...

The chat text will automatically scroll down, displaying information loaded from the database

Is there a way to ensure that chat text always remains scrolled to the bottom of the chat? I have tried multiple tutorials and examples from Stack Overflow, but none seem to work for me. Currently, my chat text overflows the textarea when there are too m ...

Why does Bootstrap not have the left offset?

Using Bootstrap 4.0 I created a row with two columns and added an offset. However, I am experiencing an issue with the offset at the left side. You can view my jsFiddle here. Has anyone encountered why the offset (col-md-offset-4) is not working on the l ...

Events related to SVG elements

I have a unique situation where a div containing multiple SVG elements that act as buttons is added to the page after the user interacts with it. I am trying to add events to these SVG elements using event delegation, where I inspect the target of the even ...

A code snippet designed to ensure uniform height for all floating div elements

Hello, I am facing an issue with resizing 20 left-floated divs of varying heights on my website. Previously, when my website was designed using pixels, a script worked perfectly for resizing them. However, after switching to a percentage-based design (% d ...

Creating a responsive design for Bootstrap divs

I am trying to display 5 images in one row with 5 columns. I have used the following CSS for this layout: .col-half-offset { margin-left: 4.166666667% } This setup works well on the web, but on mobile devices, the layout does not di ...

Challenges with Knockout.js Virtual Elements in Different Environments

I am facing a peculiar issue where a virtual knockout template fails to bind correctly when accessed remotely, yet functions perfectly when viewed locally. You can find the problematic page here: Here is the template I am using: <ul> <!-- k ...

When the mouse hovers over, alter the background color with React

Currently attempting to adjust the background color of a Grid section when the mouse enters. I've made some progress, but now I seem to be stuck. My current approach involves calling a function to update the background color on mouse enter. const [isS ...

I'm looking for a Visual Studio add-in that can identify and flag any unused CSS classes or IDs within the entire solution

Exactly as the headline suggests. If not, what are some reliable online services you've tried for decluttering oversized stylesheets? ...

Hovering over a link causes malfunction in CSS drop-down menu

I have been struggling for hours to make this drop-down menu work, but it just won't cooperate. I want the list menu .dropdown to appear when you hover over .droptoggle. I'm including the entire page because I can't figure out what's wr ...

Photo not completing the table

Hey there, I'm currently working on creating a table to showcase some products but I am struggling with ensuring that the images display at the correct size. Any assistance on this matter would be greatly appreciated. #tbldesktops { width: 100%; ...

Using Python's BeautifulSoup library to extract tables from archived HTML webpages

I'm currently working on extracting data from saved HTML webpages using Python 2.7 + Windows. There are several similar saved HTML webpages, each containing a table with 5 columns and an unspecified number of rows. The source code appears as follows ...

What is the best way to display a new line when printing a string as <pre> in HTML without using ` `

I receive a text file from the PHP server that has the following content: "File version: 5\n\nstart: 1410355285955(2014/09/10 11:58:05.955)\nend: 141090402750(2014/09/10 12:00:02.750)\nUEID: 301660031\nCNC: 1181 ...

scribbling at the heart of the page

I have been struggling to get this text centered using the following code: echo "<div class='pagination' align ='center'>"; Unfortunately, the text still appears on the left side. How can I properly center it? Additionally, I h ...

Achieving a full-width image display in Bootstrap: A guide

I've been struggling to find a solution to stretch an image across a div using CSS and Bootstrap. I attempted to make both the div and parent container fluid, but no matter what I try, there always seems to be some white space on the left and right si ...

Techniques for ensuring input validity using JavaScript

One of my form inputs is required: <input type="text" id="input-id" required> After the user submits it, I send the value using ajax and then clear it with $("#input-id").val(""). However, after this action, the input appears invalid. I want to ...

How can you utilize Javascript to retrieve an element by its inner text within the HTML tags?

As a novice, I have been struggling to find the solution to my question even after extensive searching. In the scenario at hand, I am specifically interested in locating the following element: <a href="bla" onclick="dah">some text here</a> I ...

Utilizing Vue to Transform Unicode Characters into HTML Elements

I have a scenario where an API response contains a Unicode string that needs to be displayed correctly in the view. Despite Vue treating it as a string and not automatically converting it to HTML, I believe JavaScript should handle the rendering process. ...

Scrolling triggers Navbar Hover for all links

Currently, I am utilizing a free html5 theme as a foundation for a website project, but I require assistance with the Navbar Hover function. If you wish to see the original html5 theme, you can visit The theme was initially designed as a one-page layout, ...