Set a specific width for inline list items

When it comes to having list items with images on the left and text on the right, the issue arises when each image is of a different width. This can cause the text to not align vertically next to their respective images.
Is there a way to ensure that the labels align vertically, appearing to the right of their respective images? Thank you

.checks-row {
  display: inline-block;
}

.checks-row li {
  display: inline;
}

.check-image {
  width: 4em;
}
<ul class="checks-row">
  <li class="check-image">
    <img src="/{{this.image}}.gif">
  </li>
  <li class="check-label">{{this.label}}</li>
</ul>

Answer №1

To implement the desired style, apply the following CSS code:

.checklist-row li {
    align-items: center;
    display: inline-block;
}

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

Injecting dynamic data into a function parameter with Angular 1 Interpolation

In my code, I have a feature that alters the text displayed on a button depending on certain conditions. $scope.text = 'Wait'; if(Number($scope.x) == Number($scope.y)) $scope.text = 'Go' else if(Number($scope.x) < Number($scope ...

alignment not behaving as anticipated

My goal is to position two elements on different sides within a container. Although in my coding scenario, these elements are meant to be on opposite ends of a div, for the sake of explanation, let's consider them being on opposite sides of the browse ...

Is there a way to retrieve the original value of the substr value?

I successfully retrieved the correct value using the substr() method, but I am facing difficulty in getting back the original value. Can someone please guide me on how to achieve this? For example: "AAAAAA" -> AA... but I am unable to revert from AA.. ...

Steps to set a background image for an entire page in VueJS

I recently downloaded a Background Image to add to the Home Page of my VueJS application. Unfortunately, when the page loads, only a portion of the page is covered by the image. My goal is to have the entire page filled with the image, except for the Navba ...

Include a hyperlink within every row - ngx-datatable

I am brand new to using Angular. My goal is to have a link on each row of ngx-datatable that directs me to another page when clicking on the first column of each row. This new page should be based on the row id. For example, if I have a table listing cours ...

Is there a way in Javascript to save the inner HTML of an element in a cache so that it can be re-rendered after the page is refreshed

Is there a way to cache part of a webpage on the client side using JavaScript/jQuery? Does this method have any limitations in terms of the amount of data that can be cached? How can I access this cache after refreshing the page in order to re-render it? ...

Enhancing a Vue component by including two dynamically computed class properties within a :class="{{}} {{}}" tag

As a newcomer to the Vue world, I have been experimenting with applying 2 computed properties to a :class attribute. Initially, I tried separating each property by a space like this: :class="{{prop1}} {{prop2}}", but upon reload, all content would disappea ...

Video background mute feature malfunctioning

I've searched through numerous resources and reviewed various solutions for this issue, yet I still haven't been able to figure it out. Could someone please guide me on how to mute my youtube embedded video? P.s. I am a beginner when it comes to ...

Is there a way to ensure that when displaying information boxes with Bootstrap, the inputs do not get misplaced or shuffled to the wrong location

I have been working on a form that needs to display an alert: https://i.sstatic.net/uGKtG.png When clicking the button next to the input control, an alert should appear. Although the alert is showing correctly, the input controls are shifting to the wron ...

Navigate to a specific element on a webpage upon the page's initial load in Angular 2

Is there a way to navigate from one page to another and instantly jump to a specific control in the middle of the destination page? Typically, we would use a hashtag "#" followed by the name or ID of the control. Unfortunately, this method doesn't wo ...

Cypress: measuring the size of a hidden array

Embarking on a lengthy journey here, so bear with me. TL:TR I've recently delved into learning Cypress and encountered an issue. I'm dealing with a highly dynamic list that sometimes may have zero elements. I need to determine its length for cer ...

Interactive hexagon shape with dynamic image content on click using a combination of CSS, HTML,

As a beginner in CSS, HTML, and JavaScript, I came across a code snippet to create a pattern of hexagons with images (refer to the first code below). My goal is to change the image displayed on a clicked hexagon to another picture (see second code). First ...

Guide to making a for loop using CSS custom properties and conic gradient in SCSS

Attempting to devise a for loop that will create this format for enhancing a progress bar style: progress[value="1"]::-webkit-progress-bar { background: conic-gradient( var(--progress-color) 0% 1%, var(--rest-col ...

Converting HTML Form Data into CSV with Multiple Rows

I currently have a form that generates a CSV file with data from select elements in the HTML form. The columns in the CSV correspond to the selected options in the form, but I need to extend this functionality to populate multiple rows in the CSV. Expecte ...

Designing a fluid dropdown menu with scroll functionality for my website

I have been trying to implement a scrollable dropdown menu on my website by following various tutorials, but none of them seem to be working. Despite my efforts, the dropdown menu remains non-scrollable. HTML <li> <a href="#">Team ...

AngularJS failing to display HTML content is a common issue encountered

I am a beginner in Angular JS and recently wrote a simple Angular code. However, I am encountering issues with the HTML rendering incorrectly or the expressions not getting evaluated. I could use some help identifying what I might be missing. The version ...

How can I ensure that buttons in a row utilize the full 100% of available space?

I have a row of buttons in my HTML code like this: HTML : <div class="buttons"> <div><input type="button"/></div> <div><input type="button"/></div> <div><input type="button"/></div& ...

What happens when browsers encounter unfamiliar attributes in HTML code

Direct and to the point: if I were to execute: <div id = "thisid" class = "a plethora of classes" mother = "your mother" levelofhotness = "over 9000"> I am aware that Chrome and Firefox (the browsers I typically test with) simply disregard these a ...

exploring the seamless transfer of values between Thymeleaf and Spring controllers, and vice versa

As a newcomer to thymeleaf, I'm seeking guidance on how values are passed between the thymeleaf HTML and Spring controllers. Could someone please recommend some helpful tutorials for thymeleaf-spring-mvc? In the following example, I would like to und ...

Field input displacement

I am experiencing an issue with my contact form, specifically with the message subject field displayed as a menu. The problem only seems to occur on wide desktop displays, where it appears offset from the rest of the form. Despite my efforts to troublesho ...