【发布时间】:2016-11-30 13:54:20
【问题描述】:
我终于在手机、横向和纵向上运行了我的网站,但我仍然无法在平板电脑上运行它!
我已经使用媒体查询让我的网站在手机上运行,这就是我所做的:
@media screen and (max-width: 1024px) {
body{
position: relative;
left: 100px;
}
.pintro{
position: relative;
top: 180px;
width: 500px;
}
.hintro{
position: relative;
top: 180px;
}
/* The rest of my code */
}
@media screen and (max-width: 1024px) and (max-height: 400px) {
body{
font-family: 'Noto Sans', sans-serif;
background: url("nature-blur-tree-greenex.jpg") no-repeat center center fixed;
width: 100%;
max-width: 900px;
margin: 0 auto;
position: relative;
right: 8%;
}
.pintro{
position: relative;
line-height: 50px;
left: -100px;
}
/* The rest of my code */
}
然后我尝试用平板电脑这样做,形式如下:
@media only screen and (min-device-width: 768px){
.footer{
position: reltive;
top: 1000px;
}
}
但是,那没有用。如果有人向我提供媒体查询,我可以将其放入我的 CSS 中,以便我的网站在平板电脑上运行,我将不胜感激。
谢谢。
【问题讨论】:
-
您的问题非常广泛。有很多可能的答案。考虑根据站点内容管理断点:stackoverflow.com/q/8564752/3597276
-
感谢 Isabel Inc,您的链接非常有用,而且有效。
标签: css media-queries tablet