What is the difference when using flash :error, :alert, and :notice?

前端 未结 5 1786
旧巷少年郎
旧巷少年郎 2020-12-25 11:03

As the title of the question asks, I am interested in knowing if there is any difference when using flash[:error], flash[:alert], and flash[:

5条回答
  •  有刺的猬
    2020-12-25 11:37

    this is just a classification. it generates the div #error.error or div#notice.notice you connect the logic you want above

    litte sample :

    .alert, .error, .notice, .success { padding:.8em 0; margin:0 0 2px 0; border:2px solid #ffffd; font-size:1.6em; text-align:center;}
    
    .error { background:#FBE3E4;color:#8a1f11;border-color:#FBC2C4; }
    .notice { background:#FFF6BF;color:#514721;border-color:#FFD324; }
    .success { background:#DDFCD5;color:#000;border-color:#44A815; }
    .alert { background:#FBE3E4;color:#8a1f11;border-color:#FBC2C4; }
    
    .error a {color:#8a1f11;}
    .notice a {color:#514721;}
    .success a {color:#264409;}
    .alert a {color:#8a1f11;}
    

提交回复
热议问题