Css 如何在手机(iphone)上全屏显示我的网站

Css 如何在手机(iphone)上全屏显示我的网站,css,Css,我如何能使我的网站宽度在全屏不大于屏幕我使用此代码 <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="widht=device-width, maximum-scale=1.0, minimum-scale=1.0, inittial-scale=1.0" /> <t

我如何能使我的网站宽度在全屏不大于屏幕我使用此代码

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="widht=device-width, maximum-scale=1.0, minimum-scale=1.0, inittial-scale=1.0" />
    <title>website</title>
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <link rel="stylesheet" type="text/css" media="only screen and (min-width:50px) and (max-width:730px)" href="css/style_small.css" />
    <link media="only screen and (max-device-width: 730px)" href="css/style_small.css" type="text/css" rel="stylesheet" />
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
</head>

但是,当我在手机中打开webiste时,我发现该网站并非100%在屏幕上,我发现该网站比手机屏幕大

您可以在css中使用
@media
设置不同的样式和大小,如不同设备大小的宽度和高度。在下面的css中,我只是给你一个简单的例子。您不必将所有div都放在
@media
中。只需放置那些你需要的小屏幕

@media screen and (min-width: 730px) {
    body {
    background: #fff url(../images/Bbg.jpg) 0px 0px;
    width:100%;
  }

  .adlogo {
    background-image: url(../images/lbg.png);
    width: 100%;
    margin: 0px;
    border-bottom: #999 solid 1px;
    padding-bottom: 10px;
    display: inline-block;
    position: relative;
 }

  .adlogo .ads img {
    float:left;
    padding-top:2px;
    margin-left: 1%;
    width: 98%;
    height: 50px;
}

  .adlogo .logo img {
    float:right;
    padding-top:2px;
    margin-right: 20%;
    width: 60%;
    height: auto;
  }
}

视口元标记中的
width
属性拼写错误。
@media screen and (min-width: 730px) {
    body {
    background: #fff url(../images/Bbg.jpg) 0px 0px;
    width:100%;
  }

  .adlogo {
    background-image: url(../images/lbg.png);
    width: 100%;
    margin: 0px;
    border-bottom: #999 solid 1px;
    padding-bottom: 10px;
    display: inline-block;
    position: relative;
 }

  .adlogo .ads img {
    float:left;
    padding-top:2px;
    margin-left: 1%;
    width: 98%;
    height: 50px;
}

  .adlogo .logo img {
    float:right;
    padding-top:2px;
    margin-right: 20%;
    width: 60%;
    height: auto;
  }
}