wordpress美化登录界面

WordPress默认初始登录界面非常的丑,所以不想使用,于是百度一下,找到了一些美化登录界面代码。
本次教程使用方法如下,首先在主题function.php文件相应位置添加如下代码:

//WordPress 登录界面美化 
function custom_login_style() {  
    echo '<link rel="stylesheet" id="wp-admin-css" href="'.get_bloginfo('template_directory').'/css/admin-style.css" type="text/css" />';  
}  
add_action('login_head', 'custom_login_style');

然后新建admin-style.css文件,添加以下代码至其中,放到主题css目录即可,最后刷新以下登录界面看看效果吧!

body{  
    font-family: "Microsoft YaHei", Helvetica, Arial, Lucida Grande, Tahoma, sans-serif;  
    width:100%;  
    height:100%;  
    background: url(http://ww1.sinaimg.cn/large/612ce624ly1fyv0xbije9j211y0lctb5.jpg) no-repeat;  
    -moz-background-size: cover;    /*背景图片拉伸以铺满全屏*/  
    -ms-background-size: cover;  
    -webkit-background-size: cover;  
    background-size: cover;  
}  
  
/*顶部的logo*/  
.login h1 a {  
    background:url(images/logo.png) no-repeat;  
    background-size: 220px 50px;  
    width: 220px;  
    height: 50px;  
    padding: 0;  
    margin: 0 auto 1em;  
    border: none;  
    -webkit-animation: dropIn 1s linear;  
    animation: dropIn 1s linear;  
}  
  
/*登录框表单*/  
.login form, .login .message {  
    background: #fff;  
    background: rgba(255, 255, 255, 0.3);  
    border-radius: 3px;  
    border: 1px solid #fff;  
    border: 1px solid rgba(255, 255, 255, 0.4);  
    -webkit-animation: fadeIn 1s linear;  
    animation: fadeIn 1s linear;  
}  
  
/*登录框输入框*/  
.login label {  
    color: #000;  
}  
.login .message {  
    color: #000;  
}  
#user_login{  
    font-size: 18px;  
    line-height: 32px;  
}  
  
/* 返回博客与忘记密码链接 */  
#backtoblog a, #nav a {  
    color: #fff !important;  
    display: inline-block;  
    -webkit-animation: rtol 1s linear;  
    animation: rtol 1s linear;  
}  
  
/*掉落的动画效果*/  
@-webkit-keyframes dropIn {  
    0% {  
        -webkit-transform: translate3d(0, -100px, 0)  
    }  
    100% {  
        -webkit-transform: translate3d(0, 0, 0)  
    }  
}  
@keyframes dropIn {  
    0% {  
        transform: translate3d(0, -100px, 0)  
    }  
    100% {  
        transform: translate3d(0, 0, 0)  
    }  
}  
  
/*逐渐出现的动画效果*/  
@-webkit-keyframes fadeIn {  
    from {  
        opacity: 0;  
        -webkit-transform: scale(.8) translateY(20px)  
    }  
    to {  
        opacity: 1;  
        -webkit-transform: scale(1) translateY(0)  
    }  
}  
@keyframes fadeIn {  
    from {  
        opacity: 0;  
        transform: scale(.8) translateY(20px)  
    }  
    to {  
        opacity: 1;  
        transform: scale(1) translateY(0)  
    }  
}  
  
/*从右往左的动画效果*/  
@-webkit-keyframes rtol {  
    from {  
        -webkit-transform: translate(80px, 0)  
    }  
    to {  
        -webkit-transform: translate(0, 0)  
    }  
}  
@keyframes rtol {  
    from {  
        transform: translate(80px, 0)  
    }  
    to {  
        transform: translate(0, 0)  
    }  
}

给TA打赏
共{{data.count}}人
人已打赏
Java博客

java 基础语法

2020-4-26 12:29:05

Java博客

java数据类型及关键字

2020-4-27 17:22:07

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
今日签到
有新私信 私信列表
搜索