0

我使用媒体查询来使我的网站“自适应” - 当我恢复浏览器的窗口并缩小它的大小时 - 一切正常,但在移动设备上 - 网站看起来不正确,作为完整的桌面版本,但有错误。

我在想由此引起的问题:当您进入我的网站时,您会看到它可以向右滚动,而该区域中显然没有任何元素(显示或隐藏),但我无法获得摆脱这个可滚动的空间:/

在此先感谢,对于如此混乱的问题,我们深表歉意。

这是网站:spalshmedia(dot)me

这是CSS:

body {
background-image: url("../images/background.jpg");
background-size: 20%;
background-repeat: repeat;
}

#page_wrap {
 width: 1000px;
 margin: 0 auto;
 position: center absolute;
}

.button {
-webkit-transition: all 0.2s linear;
 -moz-transition: all 0.2s linear;
   -o-transition: all 0.2s linear;
  -ms-transition: all 0.2s linear;
      transition: all 0.2s linear;
}
.button:hover {
-webkit-filter: contrast(140%);
}
.websites {

border: 0.8px solid #666666;
}

#bg_first {
 position: relative;
 left: 0px;
 top: 100px;
 z-index: 1;
}
#bg_second {
 position: relative;
 left: 0px;
 top: 25px;
 z-index: 1;
}
 #header {
width: 1000px;
margin:0 auto;
text-align:left;
position: center absolute;
overflow: hidden;
}

#headerbg {
position: absolute;
margin-top: 100px;
z-index: 2;
}
#glass_upper_left {
position: absolute;
margin-left: -400px;
margin-top: -240px;
z-index: 2;
}
#logo {
position: absolute;
padding-left: 50px;
top: 100px;
z-index: 3;
}
#generic_ideas {
position: absolute;
margin: 200px 300px;
z-index: 3;
}
#welcome_page {
position: absolute;
width: 500px;
margin-left: 10%;
margin-top: -600px;
z-index: 10;
}
#about_page {
position: absolute;
width: 600px;
margin-left: 10%;
margin-top: -275px;
z-index:10;
}
#services_page {
position: absolute;
width: 400px;
margin-left: 10%;
margin-top: 100px;
z-index: 10;
}
#rates_text {
position: absolute;
margin-left: -25px;
 }
 #contact_page {
 position: absolute;
margin-left: 475px;
margin-top: 175px;
z-index: 10;
 }
  #contact_info {
  position: absolute;
width: 800px;
height: 500px;
  }
  #navigation {
  float: left;
  position: fixed;
top: 400px;
  left: 15px;   
z-index: 4;
  }
  #menu_bg {
  position: fixed;
width: 160px;
top: 370px;
left: 0px;
z-index: 3;
  }

  #footer_bg {
  position: absolute;
 margin-top: -100px;
 margin-left: 0px;
 z-index: 2;
  }
  #copyright {
  position: absolute;
 margin-top:-25px;
 margin-left: 30px;
 z-index: 10;
  }
 @media screen and (max-width: 1200px) {
 nav, #menu_bg {
 display:none;
 }
 #logo {
 position: absolute;
padding-left: 30%;
 }
 #generic_ideas {
 position: absolute;
margin: 200px 27%;
z-index: 3;
 }
 }
 @media screen and (max-width: 720px) {
 nav, #menu_bg {
 display: none;
 }
 #generic_ideas {
 position: absolute;
margin: 200px 70px;
z-index: 3;
 -webkit-transform: scale(1.5); /* Saf3.1+, Chrome */
 -moz-transform: scale(1.5); /* FF3.5+ */
  -ms-transform: scale(1.5); /* IE9 */
   -o-transform: scale(1.5); /* Opera 10.5+ */
      transform: scale(1.5);
         /* IE6–IE9 */
         filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.9999619230641713, M12=-0.008726535498373935, M21=0.008726535498373935, M22=0.9999619230641713,SizingMethod='auto expand');
}
 #bg_first {
 position: relative;
 margin-left: 0px;
 top: 100px;
 z-index: 1;
}
#bg_second {
 position: relative;
 margin-left: -200px;
 top: 25px;
 z-index: 1;
}
#logo {
position: absolute;
padding-left: 10%;
}
#generic_ideas {
position: absolute;
margin-top: 200px; 
margin-left: 5%;
z-index: 3;
}
#welcome_page {
position: absolute;
width: 400px;
margin-left: 10%;
margin-top: -650px;
z-index: 10;
}
#about_page {
position: absolute;
width: 450px;
margin-left: 10%;
margin-top: -375px;
z-index:10;
}
#services_page {
position: absolute;
width: 400px;
left: 10%;
top: 850px;
z-index: 10;
}
#web_design_title {
position: relative;
margin-left: 115px;
}
#rates_text {
position: absolute;
width: 400px;
margin-left: -10%;
margin-top: 190px;
}
#contact_page {
position: absolute;
margin-left: 475px;
margin-top: 175px;
z-index: 10;
 }
#contact_info {
 position: absolute;
width: 800px;
height: 500px;
margin-left: -500px;
margin-top: 240px;
}

}
4

1 回答 1

2

我只看到当屏幕宽度为 720 像素及以上时产生布局更改的媒体查询,以及 1200 像素及以上的媒体查询。看起来您需要添加更多针对具有较小屏幕的设备的媒体查询。试试这个链接了解更多信息:http ://css-tricks.com/snippets/css/media-queries-for-standard-devices/

于 2013-10-09T21:49:16.010 回答