我想爲我的應用程序中的彈出式通知做出響應式設計。我使用Angular Toaster進行通知。使用Css的響應式設計
例如,我在屏幕的中心找到烤麪包機容器元素,但是使用絕對位置,所以對於較小的屏幕,通知保持在相同位置,因此不顯示它們。我想通知相對於它們所在的父元素(在這裏是容器網格)。我如何實現使用CSS?這是我的html代碼:
<body data-ng-controller="AppController">
<div id="container" class="container">
<toaster-container toaster-options="{'position-class': 'toast-container-custo','time-out': 3000, 'close-button':true}"></toaster-container>
<div id="header" data-ng-include="'partials/header/header.html'" ></div>
<div data-ng-view></div>
<div id="footer" data-ng-include="'partials/footer/footer.html'"></div>
<!-- This is the div with the overlay css class, so no matter where it is located this div inside the screen, it will cover the whole screen-->
<div id="loader" class="loading overlay" data-ng-if="loader.loading">
<p>We are loading the products. Please wait...</p>
<img alt="" src="images/ajax-loader.gif">
</div>
</div>
<div id="loginPanel" data-ng-include="'partials/content/panels/login.html'"></div>
</body>
而且我用烤麪包器容器元素自定義CSS規則:
.toast-container-custo
{
position: absolute;
top:100px;
left: 780px;
}