I have issues keeping an image and a div containing text to stay aligned correctly.
If the screen is big, all elements are correctly aligned yet if the screen is too small ( cellphone sized screens for instance ) the image gets pushed upwards such as shown here :
This is the wished result ( such as displayed on big screens )
My code is as follows ( HTML ) :
<ng-template matStepLabel>
<img class="img-logo inline vertical-align" src="{{experience.logoPath}}"/>
<div class="label-text inline vertical-align">
<h6 class="inline no-margin">{{experience.type}} - {{experience.title}}</h6>
<br />
<span class="italic-text inline">
<span [innerHTML]="experience.dateStart.replace('/', ' / ')"></span> - <span [innerHTML]="experience.dateEnd.replace('/', ' / ')"></span>
<div class="spacer"></div>
<span class="dot"></span>
<div class="spacer"></div>
<span [innerHTML]="this.getDuration(experience.dateStart, experience.dateEnd)"></span>
</span>
</div>
</ng-template>
And here is the CSS :
.mat-step-label.mat-step-label {
text-overflow: inherit;
white-space: normal;
}
.label-text {
position: relative;
}
.img-logo {
max-height: 40px;
max-width: 40px;
top: 0;
vertical-align: bottom;
padding-right: 6px;
}
.spacer {
padding: 3px;
display: inline;
}
.vertical-align {
vertical-align: middle;
}
.inline {
display: inline-block;
}
.no-margin {
margin: 0;
}
.buffer {
padding-top: 40px;
}
How can I get the logo to stay aligned on small screens ?