我最近创建了一个html页面,并根据Browsers Dev Tools使其成功响应。
我还在HTML页面中添加了<meta name="viewport" content="width=device-width, initial-scale=1">
。
在(移动浏览器的mozilla和chrome开发工具)中,一切都很好;但是,当我在实际的移动设备中对其进行检查时,某些CSS项目无法正常工作且无法正确显示!它们在容器的外部渲染!
以下是自适应CSS代码:
@media only screen and (max-width: 1024px) {
.side-title{
font-size: 0.5rem;
}
}
@media only screen and (max-width: 1024px) {
.side-content{
left:0;
right:0;
margin-left:auto;
margin-right:auto;
bottom: 0%;
width:300px;
height: 30px;
}
.side-btn-link{
top:0px;
}
.swip-helper-container{
top:70%;
font-size:8rem;
}
.side-icon{
height: 30px;
width: 30px;
font-size:1.5rem;
}
.side-btn-link:hover .side-icon {
border-radius: 0;
background-color:transparent;
color:#aaaaaa;
}
.bottom-content{
display: none;
}
.building-title{
font-size:1.25rem;
}
.constructor-title{
font-size:0.5rem;
}
.top-content{
top:0;
}
}
@media only screen and (max-width: 600px) {
.swip-helper-container{
top:65%;
font-size:5rem;
}
.side-title{
display: none;
}
.building-title{
font-size:1.05rem;
}
.constructor-title{
font-size:0.7rem;
}
.top-content{
top:0;
width:100%;
right:0;
height: 35px;
}
.seller-logo-link{
display: block;
width: 100%;
height: auto;
border-top:none;
height: auto;
}
.seller-logo{
display: none;
float: none;
margin: 0 auto;
height: 50%;
}
.title-container{
display: block;
width: 100%;
}
.building-title{
width:100%;
text-align: center;
height:100%;
margin: 0;
line-height: 2;
}
.constructor-title{
width:100%;
text-align: center;
display: none;
}
}
有人可以帮助解决这个问题吗?