How do i select part of my array for a css border?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



How do i select part of my array for a css border?



I need to create a border around each of these three contacts, So three borders in total. I am using angular/Typescript. I have to insert the border code into a css file within my project. Thanks!


import Injectable from '@angular/core';
import Contact from '../models/contact';

@Injectable(
providedIn: 'root'
)

export class ContactsService
contacts: Contact = [

firstName: 'John',
lastName: 'Doe',
phoneNumber: '1234567890',
email: 'John.Doe@example.com'
,

firstName: 'Killiam',
lastName: 'Jones',
phoneNumber: '0987654321',
email: 'Killiam.Jones@example.com'
,

firstName: 'Emma',
lastName: 'Swan',
phoneNumber: '35715948620',
email: 'Emma.Swan@example.com'

];
constructor()





You must be painting these arrays in your view. So, ideally you will need to apply Css on DOM elements.
– Charu Maheshwari
Aug 6 at 7:21





@CharuMaheshwari Not sure what you mean? It would be easy if i could select each of those contacts and assign a new class or id to them but i cant. Can you show me the correct syntax?
– Seth VanHaelst
Aug 6 at 7:52





See the following answer, if this is what you want.
– Charu Maheshwari
Aug 6 at 8:16




1 Answer
1



Try using the below code snippet. I meant this.


<style>
.contact-detail
border: solid 1px red;

</style>
<div *ngFor="let contact of contacts" class="contact-detail">
contact.firstName
contact.lastName......
</div>





OH! Great idea didnt think of that. I did this snippet. Suprisingly it worked since it had commas between each of the arrays p background-color: tomato; color: white; padding: 10px; text-align: center; font-family: Arial, Helvetica, sans-serif; list-style-type: none;
– Seth VanHaelst
Aug 6 at 13:41






Hi..@SethVanHaelst, not sure if your question is being answered or you need more help?
– Charu Maheshwari
Aug 7 at 4:36






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

make 2 or more post in bootsrap

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3

Firebase Auth - with Email and Password - Check user already registered