现场直播时造型不适用于移动设备
styling not working on mobile when live
我只是想制作一个简单的登录页面。当我在本地查看它时,一切看起来都很好,但是当我在移动设备上查看它时,将它放到网上后,背景重复并且应用了 none 的媒体查询样式。
这是我的 CSS:
@import url(https://fonts.googleapis.com/css?family=Montserrat);
html {
background-image: url("BKGND.png");
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
a {
text-decoration: none;
}
p {
color: #6A6D75;
font-family: 'Montserrat', sans-serif;
font-size: 1rem;
line-height: 1.5rem;
margin: 3% auto;
text-align: center;
}
button {
background-color: transparent;
border: 2px solid #73C23F;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
display: block;
font-family: 'Montserrat', sans-serif;
line-height: 0.3rem;
margin: 5% auto 0;
padding: 2%;
font-size: 0.75rem;
width: 15%;
height: 2.5rem;
}
#logo {
display: block;
margin: auto;
width: 20%;
}
.element {
position: relative;
top: 50%;
transform: translateY(50%);
-ms-transform: translateY(50%);
-webkit-transform: translateY(50%);
}
@media (max-width: 900px) {
button {
width: 30%;
}
#logo {
width: 30%;
}
}
@media (max-width: 600px) {
button {
width: 50%;
}
#logo {
width: 50%;
}
}
这是网站:passporte.net
在您的 <head>
标签中添加
<meta name="viewport" content="width=device-width, initial-scale=1">
并且在你的媒体查询中,让它们像那样
@media only screen and (max-width : 900px)
我只是想制作一个简单的登录页面。当我在本地查看它时,一切看起来都很好,但是当我在移动设备上查看它时,将它放到网上后,背景重复并且应用了 none 的媒体查询样式。
这是我的 CSS:
@import url(https://fonts.googleapis.com/css?family=Montserrat);
html {
background-image: url("BKGND.png");
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
a {
text-decoration: none;
}
p {
color: #6A6D75;
font-family: 'Montserrat', sans-serif;
font-size: 1rem;
line-height: 1.5rem;
margin: 3% auto;
text-align: center;
}
button {
background-color: transparent;
border: 2px solid #73C23F;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
display: block;
font-family: 'Montserrat', sans-serif;
line-height: 0.3rem;
margin: 5% auto 0;
padding: 2%;
font-size: 0.75rem;
width: 15%;
height: 2.5rem;
}
#logo {
display: block;
margin: auto;
width: 20%;
}
.element {
position: relative;
top: 50%;
transform: translateY(50%);
-ms-transform: translateY(50%);
-webkit-transform: translateY(50%);
}
@media (max-width: 900px) {
button {
width: 30%;
}
#logo {
width: 30%;
}
}
@media (max-width: 600px) {
button {
width: 50%;
}
#logo {
width: 50%;
}
}
这是网站:passporte.net
在您的 <head>
标签中添加
<meta name="viewport" content="width=device-width, initial-scale=1">
并且在你的媒体查询中,让它们像那样
@media only screen and (max-width : 900px)