Django笔记:分享一个错误页面

做个笔记。开发时处理出错,也要给用户一个良好的视觉体验。下面分享一个错误页面:
error.css

html,body {
    height: 100%;
}

body {
    color: #444;
            font: 12px/1.5 'Helvetica Neue', Arial, Helvetica, sans-serif;
    background: #f2f2f2 url("../img/blueprint.png") repeat 0 0;
}

div.da-wrapper {
    width: 100%;
    height: auto;
    min-height: 100%;
    position: relative;
    min-width: 320px
}

div.da-wrapper .da-container {
    width: 96%;
    margin: auto
}

div.da-content {
    clear: both;
    padding-bottom: 58px
}

@media only screen and (max-width:480px) {
    div.da-content {
        margin-top: auto
    }
}

div.da-error-wrapper {
    width: 320px;
    padding: 30px 0;
    margin: auto;
    position: relative
}

div.da-error-wrapper .da-error-heading {
    color: #e15656;
    text-align: center;
    font-size: 24px;
    font-family: Georgia, "Times New Roman", Times, serif
}

@-webkit-keyframes error-swing {
    0% {
        -webkit-transform: rotate(1deg)
    }

    100% {
        -webkit-transform: rotate(-2deg)
    }
}

@-moz-keyframes error-swing {
    0% {
        -moz-transform: rotate(1deg)
    }

    100% {
        -moz-transform: rotate(-2deg)
    }
}

@keyframes error-swing {
    0% {
        transform: rotate(1deg)
    }

    100% {
        transform: rotate(-2deg)
    }
}

div.da-error-wrapper .da-error-code {
    width: 285px;
    height: 170px;
    padding: 127px 16px 0 16px;
    position: relative;
    margin: auto;
    margin-bottom: 20px;
    z-index: 5;
    line-height: 1;
    font-size: 32px;
    text-align: center;
    background: url("img/error-hanger.png") no-repeat center center;
    -webkit-transform-origin: center top;
    -moz-transform-origin: center top;
    transform-origin: center top;
    -webkit-animation: error-swing infinite 2s ease-in-out alternate;
    -moz-animation: error-swing infinite 2s ease-in-out alternate;
    animation: error-swing infinite 2s ease-in-out alternate
}

div.da-error-wrapper .da-error-code .tip {
    padding-top: 2px;
    color: #e15656;
}

div.da-error-wrapper .da-error-code .tip2 {
    padding-top: 15px;
}

div.da-error-wrapper .da-error-code .tip3 {
    padding-top: 20px;
    font-size: 16px;
    color: #e15656;
}

div.da-error-wrapper .da-error-pin {
    width: 38px;
    height: 38px;
    display: block;
    margin: auto;
    margin-bottom: -27px;
    z-index: 10;
    position: relative;
    background: url("img/error-pin.png") no-repeat center center
}

p {
    margin: 0;
    padding: 0;
}

error.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>出错啦</title>
     <link rel="stylesheet" href="/static/css/error.css" type="text/css"/>
</head>
<body>
    <div class="da-wrapper">
        <div class="da-content">
            <div class="da-container clearfix">
                <div class="da-error-wrapper">
                    <div class="da-error-pin"></div>
                    <div class="da-error-code">
                        <p class="tip">STATUS:403</p>
                        <p class="tip2">服务器开小差了</p>
                        <p class="tip3">You don't have permission to access the URL on this server.</p>
                    </div>
                    <h1 class="da-error-heading">Sorry, 请稍后再试 !!!</h1>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

图片资源在此点这里获取所有资源链接,下载可直接用
效果如图
错误页面效果

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值