wordpress美化登录界面Wordpress博客 2 年前 桃李Taoli
2023-06-13 09:13:36 时间
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)
}
}
相关文章
- 新手如何安装 WordPress,建设个人博客网站?
- 前端开发博客_程序员的个人博客
- HTML中的Content-Type的类型HTML博客 2 年前 桃李Taoli
- 个人免费博客花式搭建指南 Netlify 篇
- 费马小定理(易懂)_四年rain的博客_什么易懂
- 关于博客背景_好看的博客背景图
- Satelite个人图像博客创新且优雅的WordPress主题
- fecify批量编辑商品,博客文章,自定义页面
- 李洋个人博客导航底部滚动条显示位置百分比的图文教程
- 树莓派 | Raspberry Pi 4B使用nginx+sqlite3+php7.3+typecho搭建轻量级博客系统
- 免费开源的Argon博客主题 – 简约流畅的WordPress主题模板
- 谁会拒绝一款开源的 3D 博客呢?
- Typecho 博客文章评论添加显示 UserAgent(UA)的功能
- WordPress 5.1 发布,提高编辑器性能和博客速度
- 将博客园、开源中国的博客文章导入到 WordPress 中
- 腾讯微博连接:使用 QQ 号码登录你的 WordPress 博客
- 博客上如何设置最佳 Google Adsense 广告投放位置
- 使用 Google Analytics 分析 WordPress 博客的404页面
- 如何有规律的备份 WordPress 博客
- WordPress 技巧:列出博客中所有的角色
- WordPress 技巧:使用 Gravatar 作为博客的 Favicon
- 同步 WordPress 博客日志到 Follow5
- 同步 WordPress 博客日志到嘀咕
- 疫情期间闲来无事,我自制了一个按钮展示框特效来展示我的博客
- 快速搭建MongoDB博客系统(mongodb搭建博客)
- LNMP系列教程之SSL安装WordPress博客(程序下载与安装)