The image is not correctly aligned in the center within the anchor element

In the process of working on my Angular project, I have encountered an issue with displaying components as items. Here is a snippet of the component code:

<a href="" class="list-group-item clearfix" >
<div class="container-fluid">
<div class="pull-left">
    <h4 class="list-group-item-heading">
           {{rec.name}}
    </h4>
    <p class="list=group-item-text" >{{rec.description}}</p>
  </div>

<div class="center">
    <img src="{{rec.ImagePath}}">
</div>
</div>
</a>

Additionally, here is a portion of the app.component (main file) code:

<app-header (featureselected)="onNavigate($event)"></app-header>
 <div class="container"><div class="row">
<div class="col-md-12">

<app-recipes *ngIf="LoadedFeature ==='recipe' ;else shop"></app-recipes>
  <ng-template #shop >
    <app-shopping-list></app-shopping-list>
  </ng-template>
   </div>
 </div>
</div>

The current output can be seen in this screenshot: https://i.sstatic.net/UfuZM.png

I am looking to have the image of the item displayed below the content paragraph, but I'm unsure how to achieve this. Any assistance would be appreciated.

Answer №1

Instead of using the "center" attribute, try using "mx-auto" and specify a width. This will center align the image within the block.

<div class="mx-auto" style="width: 50px;">
    <img src="{{rec.ImagePath}}">
</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

ul insertBefore causes a Uncaught TypeError to be thrown

Greetings! I must confess that I am still learning the ropes of JS and Stack Overflow, so please bear with me if my question sounds amateur. Currently, I am in the process of developing a todo list application that comprises multiple todo lists. One of the ...

The AngularJS directive seems to be having trouble receiving the data being passed through its scope

Check out this HTML code snippet I created: <div ng-controller="ctrl"> <custom-tag title = "name" body = "content"> </custom-tag> </div> Take a look at the controller and directive implementation below: var mod = angular.mod ...

The height appears differently on Mozilla compared to the Chrome browser

I currently have three sections on my website: "Header" with a height of 100px. "Content Area" with a height of 462px. "Footer" with a height of 100px. The strange issue I am facing is that in Chrome, the scroll bar is invisible (which is ideal), but in ...

Is there a way to create submit buttons that trigger printing in HTML? Additionally, how can I design a text input that spans 100% width on the same line as a <span>, <p>, or <div>?

These are the files I have: .dir { color: white; font-family: "Lucida Console", Monaco, monospace; font-size: 16px; } .cmdline { font-family: "Lucida Console", Monaco, monospace; background-color: black; border: 1px solid black; color: whi ...

Utilizing grid for styling headings and paragraphs with h3, h4, and p tags

Looking for help with aligning posts in columns? Here's the code and display challenge: <div class="post-inner"> <h3 class="post-header"><a class="post-title" href="http://www.yellowfishjobs.com/job/sales-representative/">Sales Repr ...

Modify the color of the chosen option in the dropdown menu without affecting the rest of the options

I am facing an issue with dynamic drop down lists in my HTML content. The requirement is to change the color of the selected option to dark red if the option is "success". I have implemented a jQuery function for this purpose. HTML: <select class="rea ...

What is the process for transforming Inline CSS code into an External File CSS Code?

I'm having a bit of trouble with my WordPress website. I want to format the comments section of each post to look like the image below, but I need help converting from inline CSS to external CSS and implementing it on the webpage. https://i.sstatic.ne ...

What is the reason for the absence of absolutely positioned elements in the render tree?

Recently, I came across some information about the render tree: As the DOM tree is being created, the browser simultaneously generates a separate tree known as the render tree. This tree consists of visual elements arranged in the order they will ap ...

Scale up the font size for all text on the website uniformly

Recently, I decided to switch a website's font to a non-web typeface. However, I quickly realized that the font was extremely thin and difficult to read. I attempted a simple CSS fix using * { font-size:125% }, but unfortunately, it did not have the d ...

Enhance your Datatables experience with the inclusion of a select form

Here is the code I am working with: Javascript: $(document).ready(function() { $('#example').DataTable( { "ajax": '../ajax/data/arrays.txt' } ); } ); HTML <select id="office-select" name="idOffice"> <op ...

The hamburger icon on the Bootstrap 4 navbar expands as expected, yet it fails to collapse back when

<head> <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> <script src=" ...

Tips for adjusting the height of a jQuery UI widget control through CSS

I have implemented a jquery widget on my asp.net webforms and am trying to adjust the height of the select control from the default 22px to 33px. I noticed in Google developer that the height is originally set like this: The current height setting is loca ...

Adjusting the top margin of columns in Bootstrap 3 for smaller screens

I am working with a row that has the potential for multiple columns. <div class="container"> <div class="row"> <div class="col-lg-3 col-sm-4 col-xs-6">content</div> <div class="col-lg-3 col-sm ...

iOS displaying CSS Transform issue exclusively

Creating a website that is fully mobile responsive is my goal. However, after designing the header, I realized that it wasn't displaying correctly on IOS devices like my iPad. The "Transform: translateX(-100%);" statement was functional on Android pho ...

Error: Popover Not Functioning with Angular and Bootstrap 4.3

I'm attempting to implement the popover element sample code from the getbootstrap site. System Setup: Angular 8.0.0 JQuery 3.4.1 Popper.js 1.15.0 Bootstrap 4.3.1 ToolTip 1.6.1 In my angular.json file, I have included the necessary scripts "scripts ...

Aligning icons side by side using only CSS styling

I'm having trouble positioning icons next to each other horizontally and they keep stacking on top of one another. Can you please review my CSS code to see if I made a mistake? Here is the CSS: #social { top:20px; left:30px; height:32px; width:200p ...

fullcalendar adjusting color while being moved

Currently, I have implemented a fullcalendar feature that displays entries for multiple users with different colored calendars. However, there seems to be an issue when dragging an entry to another date - the color reverts back to default. Below is an exa ...

How can I color the first, second, and third buttons when the third button is clicked? And how can I color all the buttons when the fourth button is clicked?

I am trying to achieve a task with 4 buttons. When the third button is clicked, I want the first, second, and third buttons to change color. Similarly, when the fourth button is clicked, I want all buttons to change color. Additionally, I need to save a va ...

I'm in the process of designing a Todo list platform, but I've hit a roadblock trying to figure out the best way to showcase and delete tasks

Having some trouble with creating an li element even after following the necessary steps. Any guidance and explanation would be greatly appreciated. Thank you Managing HTML and CSS is fine, but when it comes to JavaScript, I always seem to struggle. I und ...

Transform a binary large object (BLOB) file, specifically a music file, into a .WAV format using NODE.js on the server

I'm having difficulty grasping a basic concept. My Node server is successfully handling POST requests. I am sending a Blob to it (converting the blob to a .wav file). How can I save this Blob as a .wav file on disk? I want to use a music player to ...