List of items:1. The first item is elevated in its position

Can anyone explain why the first li item is displaying higher than the rest when I assign an id or class to the div element?

https://i.sstatic.net/9SMdT.png

Take a look at the code snippet below:

<div id="pickList">
    <ul *ngFor="let channel of currentPickSelection">
      <li class="list-group-item" style="float:Left;margin:1px;" (dragover)="onDragOver(channel[0])" (drop)="onDrop()"
      [ngStyle]="{'background-color': channel[0].compChannel[0].compChannelLogo.length !== 0 ? '#8EC0D1' : 'aliceblue' }">
        <ng-container *ngIf="channel[0].compChannel[0].compChannelLogo.length !== 0; else noCompChannel">
          <img class="img-rounded" src="{{ channel[0].logo }}" alt="{{ channel[0].channel }}" width="50" height="50">
          <img class="img-rounded" src="{{ channel[0].compChannel[0].compChannelLogo }}" alt="{{ channel[0].compChannel[0].compChannelName }}"
            width="50" height="50">
        </ng-container>
        <br>
        <div align="center">
          <strong>
            <font size="2">{{ channel[0].pickCode }}</font>
          </strong>
        </div>
      </li>
    </ul>
  </div>

And here's the CSS associated with the #pickList id:

#pickList {
  height:565px;
  scroll-behavior: auto;
  overflow:auto;
}

Answer №1

My solution involved the insertion of an additional div in the structure

 <div class="row pickList" align="center">
    <div>
      <ul *ngFor="let channel of currentPickSelection">
        <li class="list-group-item" style="float:Left;margin:1px;" (dragover)="onDragOver(channel[0])" (drop)="onDrop()" [ngStyle]="{'background-color': channel[0].compChannel[0].compChannelLogo.length !== 0 ? '#8EC0D1' : 'aliceblue' }">
          <ng-container *ngIf="channel[0].compChannel[0].compChannelLogo.length !== 0; else noCompChannel">
            <img class="img-rounded" src="{{ channel[0].logo }}" alt="{{ channel[0].channel }}" width="50" height="50">
            <img class="img-rounded" src="{{ channel[0].compChannel[0].compChannelLogo }}" alt="{{ channel[0].compChannel[0].compChannelName }}"
              width="50" height="50">
          </ng-container>
          <br>
          <div align="center">
            <strong>
              <font size="2">{{ channel[0].pickCode }}</font>
            </strong>
          </div>
        </li>
      </ul>
    </div>
  </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

Experience the combined power of addthis, isotope, and nicescroll - all in a single

I am utilizing a WordPress template that includes a set of share buttons from AddThis. <ul class="addthis extra"> <li class="addthis-hold"> <div class="addthis_toolbox" addthis:url="<?php the_permalink( ...

I am having trouble locating elements, both in the browser inspector tool and through Selenium automation

I've been attempting to capture elements from a specific website listed here: However, when I navigate to the element, right-click, inspect, and attempt to copy the CSS selector, ID, or XPath to search for the element using Ctrl + F, it seems impossi ...

Is there a way to integrate a Python script or code directly into an HTML document?

I am currently facing a challenge while working on an assignment. The task at hand requires me to establish a connection with an Oracle database using Python in order to retrieve information about a specific table. Subsequently, I need to display this data ...

Using Angular and Spring to Add Captcha to Your Web Application

Is there a way to incorporate captcha into an Angular application with Java-Spring Boot as the backend without using Google's reCaptcha library? The server hosting the application does not have Internet access. At the moment, I am sending a captcha n ...

Types of Content in Solr Responses

My journey with Solr has been enlightening, but I've hit a bump in the road. When querying Solr using: curl "http://localhost:8983/solr/myCollection/select?q=*:*&wt=json&rows=0" I receive a webpage displaying the JSON response. However, the ...

Tips for eliminating the shadow effect from a textbox using CSS

I need assistance with removing the shadowed edges on a textbox in an existing project. Can anyone provide guidance on how to remove this effect? Thank you for your help! ...

Implement Angular's Observable Subscription to fetch data from an API endpoint

Forgive me if I'm not using the correct terminology for Subjects and Observables. I am currently trying to subscribe to newImages in order to get a list of images. In my console, the response is as follows: [] [3] [7] [9] Each number represents ...

Applying a unique style to an element using its ID is effective, but using a class does

Incorporating twitter bootstrap tables has been a focus of mine lately, particularly when it comes to custom styling such as setting background colors for table elements. Here's what I've discovered: by assigning id="foo" to each <td> elem ...

This message is designed to validate the form as it is dynamic and

Is there a way to dynamically determine which .input fields have not been entered yet? In the following code snippet, you can observe that if I input data out of sequence, the #message displays how many inputs have been filled and shows the message in sequ ...

Excessive spacing issues arise while adjusting CSS height, leading to undesirable vertical scrolling

One of the features of my website is a post section where users can leave comments. These comments are displayed at the bottom of the post. To enhance user experience, I decided to create a modal for posts using HTML and CSS as shown below. However, I enc ...

Integrating my HTML-CSS layout into a Ruby on Rails framework

After creating a web page template using a combination of HTML, Bootstrap, and CSS, I am now looking to see it in action on my Rails application. I need guidance on how to accomplish this step by step. Can anyone provide assistance on what steps need to ...

The `.append()` function includes HTML content as plain text

I am using JavaScript to dynamically add HTML elements to my webpages. I have created a loop that iterates through all the projects, each containing multiple pictures. The first step involves generating the project title and adding it within a div element ...

What steps can I take to improve the design of this layout created using Twitter Bootstrap?

Currently, I am designing a sample form layout using Twitter Bootstrap. The form displays fields horizontally, with a link between each field. My goal is to have bullet points appear on the right side of the fields when the link is clicked. However, the al ...

Tips on uploading information from a PDF document onto a website

My goal is to develop a program or script that can extract data from PDF form fields and automatically input it into the corresponding textfields on my website, all done through the front end. The problem I'm facing is not knowing where to begin with ...

Having issues with a drop-down in Bootstrap. Is there anyone who can assist in getting it to function

I recently implemented a drop-down menu on the top navigation of my website. However, after applying Bootstrap to one of my pages, the drop-down menu stopped functioning properly. Below is the code that was applied: <link href="https://cdn.jsd ...

When embedding HTML inside an Angular 2 component, it does not render properly

Currently, I am utilizing a service to dynamically alter the content within my header based on the specific page being visited. However, I have encountered an issue where any HTML code placed within my component does not render in the browser as expected ( ...

What value is used as the default for justify content?

MDN states that the default value of justify-content is normal, even though it's not listed in the accepted values. What exactly does a normal value mean? normal This means that items are packed in their default position as if no justify-cont ...

The website does not support the zoom out or scrolling features on iOS devices

A portion of our website has been optimized for mobile devices, however, we have decided to direct iPhone users to the desktop version when accessing the Blogs section (all PHP content) at this time. While this functions properly on an iPad, we have encou ...

Inheriting Components from Templates

Insight on Motivation There are countless situations where we may require multiple components to share the same functionalities. It is not ideal (and definitely shouldn't be done!) to simply copy child components. This is where the concept of inherit ...

Why is it that my side effect action is unable to identify the return action type property?

I've been working on setting up SideEffect for my authentication store, but every time I trigger the action (TrySignIn), I keep encountering this error: "AuthEffects.authSignin" dispatched an invalid action ERROR TypeError: Actions must hav ...