Indicators and Paginator styling for PrimeNG Carousel - html

I have implemented a carousel using PrimeNG which looks like this
Notice the style of the carousel indicators and navigators. I want to have the default style of indicators/navigators for the carousel like this
I have added the imports for CarouselModule and ButtonModule in my module.ts file but it does not work. Is this possible using CSS or any other way?
PrimeNG Documentation - https://www.primefaces.org/primeng/carousel
My code:
app.component.html
<p-carousel
[value]="planDetails"
styleClass="custom-carousel"
[numVisible]="3"
[numScroll]="1"
[circular]="true"
[autoplayInterval]="3000"
>
<ng-template let-plan pTemplate="item">
<div class="centered-div">
<div class="plans">
<div class="card plan-card">
<div class="card-content">
<div class="plan-name">{{ plan?.planName }}</div>
<div class="plan-desc">
{{ plan?.description }}
</div>
<div class="plan-price">
<span class="plan-cost"
>$ {{ plan?.pricePerUser }}
<span>
<sup class="plan-currency">{{
plan?.currency
}}</sup>
</span></span
>
</div>
<div class="billing-way">per user billed annually</div>
<div class="plan-upgrade-btn">
<button
type="button"
class="remediator-blue-btn change-btn"
>
<span class="button-text" (click)="onUpgrade(plan)">
Select
</span>
</button>
</div>
<hr />
<div class="plan-features">Features</div>
<div class="plan-feature-1">
<img
src="assets/images/orange-check.svg"
alt=""
class="feature-check"
/>
<span class="feature-text"
>Daily search limit -
{{ plan.dailySearchLimit }}</span
>
</div>
<div class="plan-feature-1">
<img
src="assets/images/orange-check.svg"
alt=""
class="feature-check"
/>
<span class="feature-text"
>Maximum searches - {{ plan.maxSearches }}</span
>
</div>
</div>
</div>
</div>
</div>
</ng-template>
</p-carousel>
</div>```

Please check that you have the primeng theme in angular.json file
can you upload the styles array from your angular.json file ?
add the theme to the styles array in angular.json
"node_modules/primeng/resources/themes/saga-blue/theme.css"
to edit the navigators icons with css you can use this:
::ng-deep .p-carousel .p-carousel-content .p-carousel-prev {
}
::ng-deep .p-carousel .p-carousel-content .p-carousel-next {
}

Related

Find parent of an element in HTML DOM tree

I am trying to find the parent of the span element with label First Name and go up the DOM until i get to the input element with class "mat-input-element"
I have attempted with the following xpath, but did not get the result i needed:
//div/div/span[contains(.,'First Name')]/parent::div[#class='add-users']/lib-text-input-v3/div/mat-form-field/div/div/div[1]/input
Any help would be appreciated. Thanks!
You can try with the below xpath.
//span[normalize-space(.)='First Name']/ancestor::div[#class='input-v3']//input[#class='mat-input-element']
Sample HTML: From jsfiddle
<html><head></head><body>
<div class="add-users">
<lib-text-input-v3 errortext="”Error" a="" valid="" first="" name”="">
<div class="input-v3">
<mat-form-field class="mat-form-field">
<div class="mat-form-field-wrapper">
<div class="mat-form-field-flex">
<div class="mat-form-field-infix">
<input class="mat-input-element" type="text">
<span class="mat-form-field-label-wrapper">
</span>
</div>
</div>
<div class="mat-form-field-underline>
<span class=" mat-form-field-ripple"="">
</div>
<div class="mat-form-field-subscript-wrapper">
<div class="mat-form-field-hint-wrapper">
<div class="mat-form-field-hint-spacer">
</div>
</div>
</div>
</div>. //closes mat-form-field-wrapper class
</mat-form-field>
<div class="input-v3__label"> // same level as input-v3 class
<div class="input-v3__label--text">
<span class="ng-tns-c11-01">First Name
</span>
</div>
</div>
</div> // closes input-v3 class
</lib-text-input-v3>
<lib-text-input-v3>…..
</lib-text-input-v3></div></body></html>

Display Transfers Button at the far right corner

<div class="account-tile" qa-name="accountBlock">
<a
*ngIf="link"
class="account-detail-header"
[routerLink]="'/AccountDetails/' + account.index!"
>
<div qa-name="accountName" class="account-name">
{{ account.accountName }}
</div>
<div qa-name="accountNumber" class="account-number">
...{{ account.number | lastFour }}
</div>
<span>
<i class="gg-chevron-right"></i>
</span>
</a>
<div *ngIf="!link" class="account-detail-header">
<div qa-name="accountName" class="account-name">
{{ account.accountName }}
</div>
<div qa-name="accountNumber" class="account-number">
...{{ account.number | lastFour }}
</div>
</div>
<div class="available-balance-container">
<div class="flex">
<span class="negative-account" *ngIf="account.availableBalance! < 0"
>-</span
>
<span
[ngClass]="link ? 'format-dollar-link' : 'format-dollar-display'"
class="format-dollar"
>
$
</span>
<h2 qa-name="availableBalance">
{{ account.availableBalance | currency: '':'' | absolute }}
</h2>
<!--This is wheere the transfer button appears-->
<div class="parent=class">
<button class="button-right pull-right">Transfer</button>
</div>
</div>
<h3>Available Balance</h3>
</div>
</div>
I am trying to display a transfer button at the right corner to look like the picture above. How can I accomplish that? I tried creating a button and a class that pulls the button to the right. when I compile the code, the transfer button shows underneath the Account amount
You can add position: absolute to your transfer button.
.parent-class {
position: relative;
height: 100px;
border: 1px solid red;
}
.button-right {
position: absolute;
right: 10px;
}
<div class="parent-class">
<button class="button-right">Transfer</button>
</div>

css not working properly for slider in angular 6

I used ngfor for dynamic slider images, but the slides display one by one below the code of home.component.html.
<div class="item-slick1 bg-overlay1" * ngFor="let slide of sliders" [style.backgroundImage]="'url('+slide.slider+')'"
data - thumb="assets/images/thumb-02.jpg" data - caption="Women’s Wear">
<div class="container h-full">
<div class="flex-col-c-m h-full p-t-100 p-b-60 respon5">
<div class="layer-slick1 animated visible-false" data-appear="fadeInDown" data-delay="0">
<span class="ltext-202 txt-center cl0 respon2">
{{ slide.text }}
</span>
</div>
<div class="layer-slick1 animated visible-false" data-appear="zoomIn" data-delay="1600">
<a href="product.html" class="flex-c-m stext-101 cl0 size-101 bg1 bor1 hov-btn2 p-lr-15 trans-04">
Shop Now
</a>
</div>
</div>
</div>
</div>
How can I get a proper dynamic slider?

Why different language will influence html layout?

Here is my messageboard project, I don't know why the different will influence my css layout...
I just test english,chinese,thai they both work great, but only japanese will destroy my css style..
I use en_US,ja_JP,zh_TW,th_TH php file to change language
When use English
When use japanese
<li class="board_list">
<div class="board_img">
<img class="board_icon" src="./static/icon/board_icon.svg" alt="board icon">
</div>
<div class="board_text">
<div class="board_title">
<span>
<a href="./board.php?board_id=1">
<span>This was just test the title length of board name</span>
</a>
</span>
</div>
<div class="board_info">
<p class="p1">投稿:26</p>
</div>
</div>
<div class="board_latest">
<div class="board_latest_title">
<span>最新の投稿 :</span>
This was just test the title length of board name
</div>
<div class="board_latest_info">
<a href="./member.php?user=1" title="carry0987">
<span>carry0987,</span>
</a>
<span>2018-04-28</span>
</div>
</div>
</li>
<li class="board_list">
<div class="board_img">
<img class="board_icon" src="./static/icon/board_icon.svg" alt="board icon">
</div>
<div class="board_text">
<div class="board_title">
<span>
<a href="./board.php?board_id=2">
<span>Default</span>
</a>
</span>
</div>
<div class="board_info">
<p class="p1">投稿:6</p>
</div>
</div>
<div class="board_latest">
<div class="board_latest_title">
<span>最新の投稿 :</span>
This was just test the title length of board name
</div>
<div class="board_latest_info">
<a href="./member.php?user=2" title="carry0987y">
<span>carry0987y,</span>
</a>
<span>2018-04-28</span>
</div>
</div>
</li>
And this is my css code
.board_list {
border-width: 1px;
border-style: solid;
border-color: #E9E9E9;
}
You should add new div inside .board_list this class and add css property clear:both;
Something like this :
Also read this article : https://www.w3schools.com/cssref/pr_class_clear.asp

how to solve this css issue?

I am having some css issues...
When you hover over a product from here, you can see 'show now'..
But when you hover over the product from here, you can see 'Addto Cart' and you also see some black background for 'Add To Cart' which I am not understanding..
May I know what still I have to add in CSS..?
here is my code that displays products:
<!-- Product List -->
<div class="pl">
[product.each]
<div class="t1 col3">
<ul class="products ribbon">
<li class="product">
<a href="[product.link]">
<div class="thumbnail">
<img width="150" height="150" src="[product.image direct='1' tag='0']" class="attachment-shop_catalog wp-post-image" alt="[product.name]" title="[product.name]">
<div class="thumb-shadow"></div>
<strong class="below-thumb">[product.name]</strong>
</div>
<span class="price">
<span class="amount">
<?php if ($product->saleprice > 0 && $product->saleprice < $product->price) { ?>
<div class="prc">
<small>
<span style="text-decoration: line-through; color:blue;">[product.currency mode='sign'][product.price]</span>&nbsp&nbsp
<span style="font-weight: bold; color:red;">[product.currency mode='sign'][product.saleprice]</span>
</small>
</div>
<?php } else { ?>
<div class="prc">
<small>
<span style="font-weight: bold; color:blue;">[product.currency mode='sign'][product.price]</span>
</small>
</div>
<?php } ?>
</span>
</span>
</a>
<div class="buttons" style="opacity: 0; visibility: visible; overflow: hidden; height: 41px; ">
SHOP NOW
</div>
</li>
</ul>
</div> <!-- t1 col3 #end -->
[/product.each]
<div class="clearingdiv"> </div>
</div>
<!-- /Product List -->
so, please tell me what am I missing..? you can find CSS code in source code...
They have used a background image.
In your case you need to set a background to .buttons or the anchor in there.
BTW: please stop using inline-stylsheets; use a separate <style> block or an external CSS file instead. That way, your CSS is much easier to read and understand.