Here's a unique rewrite: "Looking to position 3 images in Bootstrap with one on the left, one in the center, and one on

Is there a way to align all images in the center, even when there are only two images coming from the backend and the center space is empty?


<div class="mm-mkt-BadgeRow row mx-auto"> 
    <sly data-sly-list.awardimages = "${aboutlo.Award_Image_LINK}">
        <div class="col-4 pl-3 text-center">
            <img src="${awardimages}" class="mm-mkt-BadgeOne" id="mm-mkt-badgeOne">
        </div>
    </sly>
</div>

Answer №1

.grid-row {
  display: grid ;
  justify-content: stretch; 
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto;
}

.grid-row div:nth-child(3n+2){text-align:center; }
.grid-row div:nth-child(3n+3){text-align:right; }
<div class="grid-row">
    <div class"item1">1</div>
    <div class"item2">2</div>
    <div class"item3">3</div>
    <div class"item1">1</div>
    <div class"item2">2</div>
    <div class"item3">3</div>
    <div class"item1">1</div>
    <div class"item2">2</div>
    <div class"item3">3</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

Layered parallax scenery

I'm interested in creating a parallax effect similar to this example. https://medium.com/@PatrykZabielski/how-to-make-multi-layered-parallax-illustration-with-css-javascript-2b56883c3f27 However, I find the use of HAML and Coffeescript in the mentio ...

What is the best way to manage the back button functionality on pages that use templates?

I am currently developing a website using angularjs. The layout consists of two main sections: the menu and the content area. For instance This is an example page: /mainpage <div> <div id="menu"> <div ng-click="setTemplate('fi ...

Inconsistencies in spacing among flex items with flexbox styling

https://i.sstatic.net/oT9dgpaA.png NavBar.js import React from "react"; import ReactDOM from 'react-dom'; import ReactDOMServer from 'react-dom/server'; import './NavBar.css'; function NavBar() { const heading ...

What is the best way to choose the parent element when the child element is checked?

I am looking to customize my CheckBox. Below is the code I have written: <div class="check-box-input"> <input type="checkbox"> </div> I also want to add a style to the parent div when the input is checked. This is the code I tried, ...

Creating input fields using Bootstrap HTML on a single line

Struggling with Bootstrap, I can't figure out how to display the following HTML inputs in a single line: <div class="row"> <div class="col-sm-8"> <div class="form-group"> <input class="form-control" ...

Navigate through the contents of a table featuring intricate colspan and rowspan elements, while keeping both headers and left columns in

I am facing a challenge with a dynamically generated table that has complex structure including colspans and rowspans. My goal is to fix the headers and, if possible, even lock the first few rows on the left side while allowing the content of the table to ...

PHP is not querying the WordPress database

My WordPress page includes an HTML submit button that triggers a post method to call a PHP file. The PHP file contains: <?php if ($_SERVER["REQUEST_METHOD"] == "POST") { echo "Hi"; global $wpdb; $result = $wpdb-> ...

React Material-UI select component malfunctions when I enclose the menu item within a Tooltip wrapper

Here is a snippet of my code: return( <FormControl sx={{ m: 1, minWidth: 80 }}> <InputLabel id="demo-simple-select-autowidth-label">Age</InputLabel> <Select labelId="demo-simple-select-autowidt ...

Having trouble with showing dynamic data in column2 of my HTML layout, and the alignment doesn't look quite right in HTML

I'm working with this HTML file, attempting to create a two-column layout using HTML and CSS. I want one column to be labeled REQUEST and the other RESPONSE. When a value is entered in the text field in Column 1, it should display a response in Column ...

What is the best way to retrieve .JPG files from a MySQL database and display them on a website using

I'm dealing with a Flask app that uses Selenium to extract an image via XPATH. The extracted .JPG image is then saved to a MySQL DB as Binary data, but I'm running into an issue when trying to render it in HTML. Any ideas on how to fix this? Co ...

Searchbox aligned to the right using Bootstrap

Looking to place a searchbox on the right next to another container aligned left: <div> <div class="pull-left"><span>SOME TEXT</span></div> <div class="pull-right"> <div class="row"> ...

Eliminate any spaces surrounding the text within the div tag

Is it possible to eliminate extra space at the end of text using CSS (or possibly JS)? I've experimented with various display properties, but none seem to be effective. I need to dynamically insert a blink-div at the conclusion of a multi-line sentenc ...

Is it possible for an ul to be displayed beneath a white section within an li

I am working on a JQuery carousel that is displaying correctly, but I want to make a small adjustment to the content: <li class="jcarousel-item jcarousel-item-horizontal jcarousel-item-1 jcarousel-item-1-horizontal" style="float: left; list-style: none ...

Calculating dimensions for parents and their children

Could someone please explain to me why the size of #child is different from that of #parent? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.or ...

Adjusting color of fixed offcanvas navbar to become transparent while scrolling

After creating a navbar with a transparent background, I am now using JavaScript to attempt changing the navigation bar to a solid color once someone scrolls down. The issue is that when scrolling, the box-shadow at the bottom of the navbar changes inste ...

Why is AJAX failing to execute PHP file from JavaScript?

The Issue: Hello, I have confirmed that my PHP file is functioning properly. However, the AJAX code connected to my JavaScript function seems to be malfunctioning. Even though the function is triggered, nothing happens as expected. The Script: Check o ...

Tips for adjusting the proximity of text to the input radio tag

Exploring css radio input style: .custom-radio-input { width: 80%; display: flex; flex-direction: row; justify-content: center; } .radio-block { width: 50px; } Next, within the form, there are radio inputs: <div class="custom-radio-input ...

Is Javascript automatically generated by asp.net?

If I were to initialize a fresh VS project and paste the subsequent sample code into a freshly created page default.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="WebApplication1._default" %> <!DOCTYPE ...

A div element with a z-index of 9 remaining below another element with a z-index of 1

Even with a higher z-index, my <h4> and <a> elements are not visible above the background. <section class="no-padding main-slider mobile-height wow fadeIn"> <div class="swiper-full-screen swiper-container height-100 width-100 whit ...

Adjust image size according to the browser's window resize using JQuery

I am trying to make an image resize based on the browser size changes using JQuery. My goal is for the image to scale without losing its aspect ratio or getting cropped. I have incorporated Bootstrap in my HTML structure: <div class="container-fluid" ...