2016-07-14 26 views
0

我使用此代码显示闪光灯消息如何在keystone.js中使用flash消息?

req.flash('success', 'Data saved...!!!'); 

当显示提示信息,它看起来像的网站内容的一部分。那么,有没有其他方式可以在keystone.js中显示讯息。 enter image description here

回答

0

你只需要一些CSS,使其固定在屏幕的高于一切的中心:

#flash-messages { 
    position: fixed; 
    top: 50%; 
    left: 0; 
    right: 0; 
    display: block; 
    z-index: 9999999; 
    text-align: center; 
} 

.alert{ 
    box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.34); 
    color: #fff; 

    h4 { 
    font-size: 4rem; 
    } 
} 
.alert-warning { 
    background-color: #d80000; 
    border-color: #9c0000; 
} 
.alert-success { 
    background-color: #2c9800; 
    border-color: #247d00; 
}