Unify学习笔记2

今天从最简单的404错误网页开始。

删减掉整个网站用的css和js,404页面的代码如下:

<!DOCTYPE html>
<html lang="en"> 
<head>
    <title>404 Error Page 1 | Unify - Responsive Website Template</title>
    <!-- Meta -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">    
    <!-- CSS Global Compulsory -->
    <link rel="stylesheet" href="assets/plugins/bootstrap/css/bootstrap.min.css">    
    <!-- CSS Page Style -->    
    <link rel="stylesheet" href="assets/css/pages/page_5F404_error1.css">    
</head> 
<body>
<!--=== Content Part ===-->    
<div class="container">
    <!--Error Block-->
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="error-v2">
                <span class="error-v2-title">404</span>
                <span>That’s an error!</span>
                <p>The requested URL was not found on this server. <br> That’s all we know.</p>
            </div>
        </div>
    </div>
    <!--End Error Block-->
</div><!--/container-->
<!--=== End Content Part ===-->
<!-- JS Global Compulsory -->           
<script type="text/javascript" src="assets/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript" src="assets/plugins/jquery/jquery-migrate.min.js"></script>
<script type="text/javascript" src="assets/plugins/bootstrap/js/bootstrap.min.js"></script> 
<!-- JS Implementing Plugins --> 
<script type="text/javascript" src="assets/plugins/backstretch/jquery.backstretch.min.js"></script>
<!-- JS Page Level -->
<script type="text/javascript">
    $.backstretch([
      "assets/img/bg/2.jpg",
      "assets/img/bg/8.jpg",
      ], {
        fade: 1000,
        duration: 7000
    });
</script>
</body>
</html> 

错误提示所在层使用黑色半透明背景background: rgba(0,0,0,0.5);通过调用backstretch插件,动态切换两张星空背景图。整个网页简洁有序。

调用backstretch动态切换背景的代码如下:

<script type="text/javascript">
    $.backstretch([
      "assets/img/bg/2.jpg",
      "assets/img/bg/8.jpg",
      ], {
        fade: 1000,
        duration: 7000
    });
</script>

第二个404错误页面,东西多了些,最有创意的一点是,用一个背景半透明的层通过错位和旋转,为另一个层做了个三角形的背景效果,其中作为背景的层的样式如下:

.service-bg {
    width: 250px;
    padding: 60px;
    position: absolute;
    top: -10px;
    right: -100px;
    background-color: rgba(255,255,255,0.1);
    transform: rotate(55deg);   
    -o-transform: rotate(55deg);
    -ms-transform: rotate(55deg);
    -moz-transform: rotate(55deg);
    -webkit-transform: rotate(55deg);
}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值