在主题目录中functions.php文件里添加以下代码
function login_scripts() {
wp_enqueue_style( "login-index", get_template_directory_uri() . "/css/defaultlogin.css" );
}
add_action('login_enqueue_scripts', 'login_scripts');
然后打开代码编辑工具,开始你的创作吧,至于页面有哪些class、id等自己打开浏览器后f12去查吧,下面的css只是简单修改哦
.login {
position: relative;
background-image: url("https://www.teelm.com/wp-content/uploads/2018/09/20180906044241rosa12.png");
background-position: center;
background-size: cover;
}
#login {
position: absolute;
left: 50%;
margin-left: -200px;
padding: 0;
top: 50%;
margin-top: -300px;
background: #fff;
width: 400px;
border-radius: 4px;
h1 {
padding: 30px 0;
a {
background-image: url("https://www.teelm.com/wp-content/uploads/2018/09/20180906044241rosa12.png");
border-radius: 50px;
box-shadow: 0 0 10px 5px #e4eaef;
background-size: 80% auto;
background-position: center;
margin: 0 auto;
width: 80px;
outline: none;
height: 80px;
transition: all .2s;
&:hover {
box-shadow: 0 0 10px 5px #bfd9ef
}
}
}
form {
box-shadow: none;
margin-top: 0;
padding: 10px 30px 2px;
input {
padding: 7px 10px;
margin-top: 8px;
font-size: 16px;
border-radius: 4px;
height: 40px;
&:focus {
border-color: #419df5;
box-shadow: 0 0 2px rgb(123, 184, 243);
}
}
.forgetmenot {
padding-bottom: 20px;
padding-top: 7px;
input[type=checkbox], input[type=radio] {
width: 20px;
height: 20px;
margin-top: 0
}
}
.submit {
float: none;
input[type=submit] {
width: 100%;
background: #419df5;
border-color: #419df5;
line-height: 40px;
padding: 0;
text-shadow: none;
box-shadow: none
}
}
}
#nav, #backtoblog {
padding-left: 30px
}
}
@media screen and (max-width: 767px) {
#login {
left: 5%;
margin-left: 0;
width: 90%
}
}
记得defaultlogin.css文件的路径哈,别整错了是在启用的主题的文件夹下,上面代码是保存在主题文件夹的css文件夹里的
本站所有文章,如无特殊说明或标注,均为本站原创发布。
任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。
如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。










