When the content of the <p>
tag loads dynamically with varying heights, setting the position of the ion-button
fixed at the top using properties like margin-top: -20px;
may not work as expected when the p
tag contains a large amount of data. How can I handle this scenario to dynamically adjust the position of the ion-button
?
.html
<ion-row>
<ion-col size="12">
<h3 class="title">{{ data?.name }}</h3>
<p class="opening" [innerHTML]="data?.workingHours"></p>
<ion-button *ngFor="let button of data.buttonlinks" fill="outline"
class="menu-button" color="primary">
{{ button.name }}</ion-button>
<div class="inner-html" [innerHTML]="data.description"></div>
</ion-col>
</ion-row>
.scss
.opening {
font-size: 14px;
font-weight: 500;
color: #4A4A4A;
}
.menu-button {
margin-top: -20px;
margin-bottom: 16px;
margin-left: 16px;
}
UI: