r/csshelp • u/rassawyer • Jun 02 '23
Request What am I doing wrong?
SOLVED!
Why does one element render correctly, and the other not? The first element is perfect, but the second, the weekChart, place the chart below the first element, but the buttons, and the date range at the far end.
HTML:
<section>
<div class="dayRow">
<button (click)="decrementDay()" mat-button>Prev</button>
<div>{{ dayStart | date }}</div>
<button (click)="incrementDay()" mat-button>Next</button>
</div>
<app-timeline [worklogs]="(daysWorklogs$ | async) || []"></app-timeline>
</section>
<section>
<div class="weekChart">
<button (click)="decrementWeek()" mat-button>Prev</button>
<div>{{ weekStart | date }} - {{ weekEnd | date }}</div>
<button (click)="decrementWeek()" mat-button>Next</button>
</div>
<app-timeline-week></app-timeline-week>
</section>CSS:
.dayRow {
display: flex;
align-items: center;
> div {
margin: 0 15px;
}
}
.weekChart{
display: flex;
align-items: center;
> div {
margin: 0 15px;
}
}Solution: I needed to wrap the charts themselves in <div> tags, and assign styling to them.
1
Upvotes
View all comments
Show parent comment
1
u/rassawyer Jun 04 '23
The second chart doesn't have any data yet. The label is there although very small. (Time Blocks). What I'm trying to solve, is why when display: flex; is used, the prev + next buttons, and the date range display all the way at the end of the first chart instead of below it.