The issue with the vertical alignment of images within a div using CSS seems to be unresolved

I have these blocks on my website that describe various features. Within each block, there is a div element containing an image, and I'm trying to vertically align the image in the middle of the div. However, my current code doesn't seem to be working as expected. Here's a snippet of my HTML:

<div class="col-3 feature_block">
    <div><img src="{{ URL::asset('pic/services1.svg') }}"/></div>
    <h4>Automated Processes</h4>
    <p>Processes that are automated start with a simple user input.</p>
</div>

This is what my CSS looks like:

.feature_block div{
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 25px 0;
    background-color: white;
    text-align: center;
    line-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

Currently, this is how it appears in the browser - screenshot link here

If you could provide assistance, it would be greatly appreciated. Thank you!

Answer №1

Success!

.feature_block div{
display:flex;
justify-content:center;
align-items:center;
}

Answer №2

The name of your class is col-3. Therefore, your CSS code should follow this structure :

 .col-3 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

how to dynamically add classes in jsx with a combination of tailwind and regular classes

Why is it that in Nextjs 14 (ReactJS 18), when I conditionally assign css classes within a jsx code like this: <Swiper className={lightbox ? "swiperLightbox h-[80%] md:h-[70vh] z-50" : "swiperMain h-[21vmax] rounded-xl"} > ...

What is the correct method for formatting a JavaScript tag?

As someone who has been developing web apps since 1996, I am constantly exploring new approaches to familiar tasks. This has led me to ponder on the best JavaScript tag to use for my latest projects. Currently, I tend to utilize something like the followi ...

Struggling with CSS to display images

Struggling to align my images within the designated red lines in the CSS sections I created. Can't seem to get it right. Here's my HTML: <!-- Your code goes here --> <div class="container"> <section class="left"> <h1& ...

Tailwindcss's responsive design suffers from sluggish performance

Currently, I am working on creating a blog using Next.js and I am looking for a way to display or hide the Table of Contents (TOC) based on responsiveness requirements. Although I am utilizing Tailwind CSS for styling, I am experiencing slow reactions. I ...

Incorporate new functions through the css class name "javafx"

On my dashboard, I have 10 labels that share the same CSS class for mouse over events. Now, I want to change the button style after it is pressed and remove the mouse over effect. How can I achieve this? ...

What is the best way to navigate to a particular div within an iframe?

In one of my div elements, I have embedded an iframe with a source URL like this: <div> <iframe ng-src="{{somesourceurl}}"></iframe> </div> The content loaded by the iframe contains HTML with uniquely identified div tags as sh ...

Struggling with finding the appropriate CSS selector?

I'm struggling to find the correct selector. Let me do my best to explain the situation: I am currently working on a project where I am unable to make changes to the HTML and JavaScript due to dynamic content and other constraints. Within this proj ...

Issue with SVG mask not functioning when transform is applied

I am struggling to apply a mask to a transformed SVG element. When I try to do this with a path, the structure is the same. If I apply the mask to an element outside of the transformed group, it works as expected. However, if I try to do the same inside, t ...

Interactive form design using Bootstrap - combining labels, input fields, and buttons in a streamlined inline

Looking for a clean HTML markup without the need for custom CSS like Bootstrap, my goal is to achieve a design similar to the demo I created on bootply - http://www.bootply.com/1Uy4UROiEz The only issue with the above demo is that I want the go button to ...

Python3 Scraping Printer`s website is malfunctioning when using Selenium

Apologies in advance if my question is not presented correctly or if I have missed any rules. My background is in Network Security Administration, but I have recently started studying Python. After some practice, I attempted to write my first code to retri ...

Strategies for effectively handling browser history in a dynamically loaded JavaScript application

I recently developed a website with two dynamic sidebars - one on the left and one on the right. Both sidebars are configured to load content asynchronously using the .load() function (from leftside.html and rightside.html). The left sidebar contains a m ...

Integrating variable interpolation within media queries using Compass/Sass

Is there a method to achieve the desired result in Compass/Sass? $padding: 3em div { padding: $padding; } @media screen and (max-width: 780px) { $padding: 2em; } /* Result: div { padding: 3em; } @media screen and (max-width: 780px) { ...

Retrieving and storing data between a database and text fields

Trying: Extracting information from the database to text fields (the database contains infinite data so it is not feasible to name each field individually), then modifying the data and updating it back to the database. Issue: Unable to assign names to th ...

Using a border-radius of 50% is causing imperfect circles to appear in the Chrome browser

Typically, using border-radius: 50% is effective for many situations, and in Chrome it creates a circle appearance. However, when attempting to rapidly rotate a circle in this specific case, an issue arises. Is this a glitch with Chrome's border-radi ...

HTML - implementing a login system without the use of PHP

While I am aware that the answer may lean towards being negative, I am currently in the process of developing a series of web pages for an IST assignment in Year 9. Unfortunately, the web page cannot be hosted and our assessor lacks the expertise to utiliz ...

To integrate existing code in Angular, it is necessary to transfer it to a partial or another component to showcase it within the

My Angular SPA is functioning well, but now the business wants me to transfer the code from the file link-group.html (which has its own controller and module) to the supervisors.html file. Here are the details: The URL with the code to be placed into a te ...

Having trouble interacting with an xpath-selected element in Selenium using Python?

I've been attempting to click on an element that I've selected using Xpath, but it appears that I am unable to locate the element. Specifically, I'm trying to click on the "Terms of Use" button on the page. The code snippet I've written ...

Is there a way to bypass media queries in a CSS file?

I'm working on a web project that includes a CSS file with media queries. However, for one specific page, I do not want to apply the media queries from this CSS file. How can I exclude them just for that particular page? ...

unable to view the contents of the template using the directive

I am facing an issue with the Directive, as it is not adding an element to the Template. This directive has been included in the .html file. There are no errors being displayed in the console. directive.js: app.directive('myDirective', function ...

Ways to choose a distant relative in XML using XPath

To target all direct <p>...</p> elements inside a div, the selector would be div/p If I wish to select all second-level nested <p>...</p> tags within a div, I could use div/*/p Can a specific range be specified instead? div/descen ...