The Bootstrap button is unresponsive, even after attempting to change the cursor to a pointer and adding a click event - no luck

I'm a beginner with Angular and Bootstrap, and I recently came across some code on a website that I tried to implement into my project. However, I encountered an issue where the button was not functioning properly. I would greatly appreciate any assistance in resolving this problem.

<div class="container">
    <div class="row">
      <div class="col-12 col-sm-8 col-md-6 col-lg-4" *ngFor="let P of products">
        <div class="card" *ngIf="P.Category == selectedCategory">
          <img class="card-img" src="{{P.Img}}" alt="Vans">
          <div class="card-img-overlay d-flex justify-content-end">
          </div>
          <div class="card-body">
            <h4 class="card-title">{{P.Name}}</h4>
            <h6 class="card-subtitle mb-2 text-muted">Serial No. {{P.SerialNumber}}</h6>
            <p class="card-text">{{P.Description}}</p>
            <div class="buy d-flex justify-content-between align-items-center">
              <div class="price text-success"><h5 class="mt-4">${{P.Price}}</h5></div>
               <button type="button"  (click)="addToCart(P)" class="btn btn-danger mt-3 curs"> Add to Cart</button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

Here is the CSS code related to the issue:

body {
    padding: 2rem 0rem;
  }
  
  .like {
    font-size: 1.5rem;
  }

Your help is highly appreciated. Thank you!

Answer №1

Have you added the bootstrap CDN link for CSS? If not, you can insert this code snippet below your CSS file inside the head section:

<link href="https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">

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

What steps can be taken to repair the footer area within this CSS document?

As a beginner ASP.NET developer, I am encountering CSS for the first time. The CSS file I have is fairly simple, but I am facing difficulties with the footer section. The current appearance of the footer is as follows: I am looking to make the following m ...

The h3 tag listener is not functioning as expected

I'm seeking assistance with the listeners for my pomodoro clock, specifically for minBreak and plusBreak. Oddly enough, the listeners for minWork and plusWork in jQuery are functioning properly, but the ones for minBreak and plusBreak are not. Any ins ...

The functionality to display or conceal divs containing repeaters is not functioning properly

Having a bit of trouble trying to display one div with a slideshow and hide another containing a list of images on larger screens, like desktops. I want to do the opposite on smaller screens. Both Div's have repeater controls, but I don't think t ...

Adding a box shadow around the entire div in Internet Explorer 11 with CSS

I am having difficulty applying box-shadow to create a shadow around the entire perimeter of a div. While it works in FireFox, it does not work in IE 11. So far, I have attempted solutions from this StackOverflow thread. For reference, here is a JSFiddle ...

PhoneGap Android: Strange behavior with input color and focus (demonstrated with visuals!)

I'm encountering two issues with the input box in my PhoneGap HTML5 CSS3 application. 1) Whenever I select or focus on the input, the background color changes to white and the text color becomes black. Have I overlooked a specific CSS property for th ...

Is there a way to connect a CSS external file that is saved on Dropbox?

Is it possible to link an external CSS file stored in Dropbox with HTML? I have followed all the instructions I could find online, including clicking and pressing "Copy Dropbox Link" to generate an href link. However, it doesn't seem to be working. ...

What is the best way to center my error message in Simple_form for Ruby on Rails?

Currently, my form is displaying an error message (Name is a required field) in this format: However, I want to position the 'can't be blank' error next to the 'Name', like so: To achieve this layout, I made modifications to the ...

What is the best method for arranging components?

I have a Product component that contains crucial information about various products. Adjacent to this data, there is a separate component called Buttons, which includes two buttons - one for adding the product to a favorites list and another for adding it ...

Implementing nested resolvers in Angular can be achieved by utilizing the power

One of the components in my project retrieves a category using a resolver. Here's how it's done: ngOnInit() { this.category = this.route.snapshot.data['category']; } It works great and fetches a list of users which make up the cat ...

jquery is failing to apply the desired background color

Creating animations with jQuery <script> $(document).ready(function(){ $("button").click(function(){ $("h2").animate({backgroundColor: '#00f', width: '50%', marginLeft: '50px'}); }); }); </script> Writing ...

Error Encountered: White screen issue affecting Ionic 6 / Angular 14 app running on Android 6.1 device without Google Mobile

After successfully deploying my new Ionic 6 / Android 14 app on multiple devices, I encountered a problem with one specific device - a Zebra ET50 running Android 6.1 without Google Mobile Services. The app fails to load and only shows a white screen. I no ...

Validation of select inputs in Bootstrap 4 using bootstrap-validate

I have been using the bootstrap-validate plugin for Bootstrap 4, which can be found here. Currently, I am attempting to validate a select input in the following way: <div class="form-group"> <label for="numberOfBedrooms">Number of Bedroom ...

How to create a collapse feature that allows only one item to be open at a time in Angular

I developed an angular app with a collapse feature, but I noticed that multiple collapses can be open at once. I am utilizing Ng-Bootstrap collapse for this functionality. Below is the code snippet from the TS file: public isCollapsed = true; And here is ...

Eliminating border styles alters the overall appearance of the page

I'm encountering an issue with my HTML/CSS code here: CSS * { padding: 0; margin: 0; border: none; outline: none; } #container { margin: 10px auto 10px auto; width: 960px; background-color: #dddddd; border: solid 1px black; } #contai ...

How can JavaScript be used to rearrange the placement of DOM elements?

<!DOCTYPE html> <html> <head> <title></title> </head> <body> <div class="boxes"> <div class="red" style="width: 300px; height: 300px; color: red"></div> <div class="blue ...

Arrangement of box and buttons on R shiny interface

My dashboard page features action buttons aligned to the left, along with a plot and two additional zoom and reset buttons. I am looking to center the box on the screen and position the zoom and reset buttons at the top right corner. I attempted to use t ...

I am struggling to activate the hovering feature on my menu bar

I am having trouble making the hover effect in my navigation bar work properly. Even though I can separately make the 'display: none' and hover effects work, they do not function together. I am unsure of what mistake I might be making. Below is ...

Reacting to a situation where the tailwind grid has an issue: the responsive column span is visible in the HTML, but

I'm having an issue with a grid that is not behaving as expected. I have set up a jsfiddle to show the behavior I am looking for, which relies on the responsive code: col-span-3 md:col-span-2 for one of the items. The problem arises when I inspect th ...

Centered content appears smaller than the surrounding div

After spending an hour trying to troubleshoot and searching for solutions, I am turning here for help. I am attempting to insert a Bootstrap Nav-Bar into a Div. I successfully centered the Nav-Bar, but now my Div is taller than the content inside it. This ...

Steps for rearranging the Bootstrap carousel

I am looking to rearrange the carousal indicators so that they show up below the caption. You can view a demonstration of the carousel in action by visiting the following fiddle: <pre> https://jsfiddle.net/w1jjeh7L/ </pre> My goal is to a ...