Remove item with style list action button

<ol>
    <li ng-repeat="name in itemArray">
        {{ name }}
            <button id="deleteBtn" ng-click="deleteItem (item)">X</button>
    </li>

</ol>

Indeed, this code snippet contains AngularJS functionality to display a list with delete buttons next to each item. The challenge lies in adding spacing between the list items and the delete buttons. Despite attempts to adjust the styling, the desired spacing has not been achieved yet. Omitting CSS for simplicity.

Answer №1

To create space on the left side of the button, simply add a margin-left property in your CSS code. Your CSS would look something like this:

#deleteBtn {
    margin-left: 10px;
}

Check out this example on jsFiddlse

Answer №2

Here is an example of HTML:

<ul>
    <li ng-repeat="person in peopleArray">
        {{ person }}
            <button id="removeBtn" ng-click="removePerson (individual)">Delete</button>
    </li>

</ul>

This CSS code will align the delete button to the right:

#removeBtn {
    float: right;
}

You can view the demo on JSFiddle

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

unnecessary shading effect on SVG text

My SVG text suddenly has a strange drop shadow that I can't seem to get rid of. Despite checking the reference guide I purchased on Amazon, I still haven't found any solutions. There are no filters applied and the markup seems to align with examp ...

Develop a custom Dockerfile for hosting a Python HTTP server in order to showcase an HTML file

I have a folder containing a single HTML file (named index.html) with basic text. When I execute the python command: python -m SimpleHTTPServer 7000 a server is initiated at port 7000 in the same directory to display the page in a web browser. Now, I am ...

The scrolling navigation bar appears behind the slider, causing the parallax effect on the slider to not work properly

While I was scrolling down, my menubar went behind the cycle slider. I tried using z-index 1, but it's not working. Can anyone provide a solution? I'm not sure what I did wrong. </div> <img src="http://malsup.github.io/imag ...

"Discover the magic of jQuery: Unveiling the hidden div with one simple CSS visibility change

I want to implement a functionality on my screen where the Previous button is hidden initially and only becomes visible when the user clicks the Next button. I have set the CSS property for the Previous button to hide it by default, but despite using an if ...

The SVG element within Bootstrap 4, when using the viewBox attribute, does not always resize consistently

I am in the process of making my website design responsive, starting with the SVG logo. Following the excellent suggestions by Amelia Bellamy-Royds, I have included attributes for viewBox,preserveAspectRatio, x, y, width, and height. I'm facing vario ...

Passing Select Box Value as Foreign Key in Django: A Step-by-Step Guide

Hello, I am currently developing a Django web application. Within this app, there is a select box that contains all objects from a specific model. This select box is generated in the template and is not directly part of the form. When a user submits the fo ...

Developing with Angular.js using $http.get requests to access local APIs

I'm currently in the process of configuring a local development environment for an Angular.js application that pulls data from a remote API. However, I've encountered a roadblock with the cross-domain origin policy. The API only provides a JSON r ...

Is there a way to make text fade in and out smoothly instead of abruptly disappearing and reappearing after an animation ends?

I'm seeking a unique animation effect for my right-to-left scrolling text. Instead of the text teleporting back to its origin at the end of the animation, I would like it to smoothly disappear and reappear from the margins. .custom-animation { he ...

Why is tr.myClass not functioning properly without the presence of >td? How can I determine the

In my HTML, I have a table as shown below: var selector = $("#searchResultsArea"); $.getJSON(url, null, function (data) { selector.empty(); var html = "<table id=\"tabRoom\" style=\"width: 950px; border:none\" class=&b ...

How to customize the arrow color of tooltips in Bootstrap 4

After spending an hour searching online, I still can't figure out how to change the tooltip arrow color to red. None of the code snippets I found seem to work for me. My latest attempt was: .tooltip-arrow { border-right-color: red; border-left-c ...

encountering difficulties when inserting a div in between slick.js slides

Incorporating slick.js with Angular, I am facing a challenge in adding a custom div with a dashed border after each image in my slick slider. This div should be positioned between the gaps of two slides. The slick slider is implemented with vertical scroll ...

The Bootstrap modal is making the content below shift to the left

Encountering an issue with our Bootstrap modal causing the content to align left, specifically on certain Macbooks using Chrome. Interestingly, the problem is present on my co-worker's computer but not on mine, even though the specifications are the s ...

unable to determine the reason for the undefined value

My function is designed to remove an element tag when it's clicked on and also remove the corresponding content/ingredient from another list. Everything seems to work fine in the browser, but when I check the console, a TypeError pops up, and I can&ap ...

Is there a way to target a button within an anchor tag without relying on a specific id attribute?

On my webpage, I have buttons that are generated dynamically using PHP from a MySQL table. Each button is wrapped in an anchor tag and when clicked, it triggers a Javascript function to carry out multiple tasks. One of these tasks requires extracting the ...

Retrieve Array Field from PHP CURL Response (Response Presented in HTML)

Currently, I am utilizing PHP CURL and receiving the data in HTML format as a response. The data is being returned in array format, so my question is how can I extract the necessary information from that array. I need to store the response in the $respo ...

Obtain all the data in the table cells using Jquery

I've been tasked with a unique challenge. There's a table with a form inside it, and I'm using Jquery to handle the form. Is there a way to retrieve the data from the <td></td> element without any specific id or class? The situa ...

Creating a sleek dark-themed table using Bootstrap's HTML

While browsing through https://getbootstrap.com/docs/4.0/content/tables/, I came across a table with a really dark background towards the bottom of the page. I tried copying the code into an HTML document, but it didn't seem to work. After tinkering w ...

Dimensions properties for a webpage displayed within a DIV element

I was attempting this in an iframe previously, but now I have managed to make it work in a DIV. However, I am facing issues in achieving the desired properties. When I try to modify the properties of the 'siteloader', it seems to ignore the embe ...

Trouble populating the AngularJS multiple select dropdown

I have a select box that allows for multiple selections, with a model connected to it. To see my basic setup in action, check out this JSFiddle. Everything seems to be working correctly - the values from my predefined dataset show up automatically in the m ...

After calling dismiss(), the Ionic loading controller remains persistent in its presentation

Recently, I implemented the loading controller as a separate service and utilized the present and dismiss methods inside the HTTP interceptor. However, even after the request is released by the interceptor and the dismiss method is executed, the loading mo ...