Change the class depend on the windows weight
<div [ngClass]="classOnSmartphone()"></div>
modalOnSmartphone(){ const screenWidth = window.screen.width; if(screenWidth < 750){ return "normalScrollEle"; } return ""; }