缩放网站以适应移动屏幕

Scaling Website to Fit Mobile Screens

所以我在一个小网站上工作,http://www.liftlists.com,作为一个夏季项目,只是为了更好地进行网页设计和编程。到目前为止,在设计方面一切都很顺利,但我在让它适应移动设备时遇到了很多麻烦——它每次都会显示完整的网站。我已经将 .container 更改为流畅的,将表格更改为响应式的,但它仍然不适合移动页面。我正在使用 Bootstrap、jQuery 和一些 Angular 到 运行 网站。

我在这里做错了什么?我看过其他问题,但每个问题似乎都提前 problem.Thanks 略有不同!

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, user-scalable=yes">

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.0-rc.1/angular-animate.js"></script>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

<script src="liftscript.js"></script>
<script src="dropdown.js"></script>



<style>

body { 
    background-color: #516774;
}

    .container-fluid{
        width: 800px;
        margin: 0 auto;
        padding-top: 2cm;

    }

.large-background {
        background: url('big_background2.jpg') no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;

    }

    .nav_heading {
        background: #ededed;
        color: #222;
        margin: 0px;
        text-align: center;
        padding: 10px;
        margin-bottom: 20px;
        box-shadow:-1px 1px 1px rgba(0,0,0,0.15);
        display: none;

    }

    .below_heading {
        display: none;
    }

    ul.tabs{
        margin: 0px;
        padding: 0px;
        list-style: none;
        box-shadow:-1px 1px 1px rgba(0,0,0,0.15);
        background: #ededed;

    }

    ul.tabs li:hover {
        background-color: yellow;
    }


    ul.tabs li{
        background: none;
        color: #222;
        display: inline-block;
        padding: 10px 15px;
        cursor: pointer;

    }

    ul.tabs li.active{
        background: rgba(255,255,255,0.90);
        color: #222;
    }

    .tab-content{
        display: none;
        background: #ededed;
        padding: 5px;
        box-shadow:-1px 1px 1px rgba(0,0,0,0.15);
        margin-bottom:70px;
    }

    .tab-content.active{
        display: inherit;
    }

    .info {
    display: none;
    background: #ededed;
    padding: 15px;
    box-shadow:-1px 1px 1px rgba(0,0,0,0.15);

}

    #button-float {
    float: right;
}

    .float {
    float: right;
}
    #inside_nav_heading {
    display: none;
    background: #ededed;
    color: #222;
    margin: 0px;
    text-align: center;
    margin-bottom: 20px;
    padding-top: 5px;

}

    .footer {
    position: fixed;
    bottom: 0;
    padding-top: 10px;
    width: 100%;
    height: 40px;
    background-color: rgb(51, 51, 51);
    color: white;
}

.ig-b- { 

    display: inline-block; 
}
.ig-b- img { 
    visibility: hidden; 

}
.ig-b-:hover { 
    background-position: 0 -60px; 
} 

.ig-b-:active { 

    background-position: 0 -120px; 

}
.ig-b-24 { 

    width: 24px; height: 24px; background: url(http://badges.instagram.com/static/images/ig-badge-sprite-24.png) no-repeat 0 0; 
}

@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) {

.ig-b-24 { 
    background-image: url(http://badges.instagram.com/static/images/ig-badge-sprite-24@2x.png); background-size: 60px 178px; 
} 

如果将 .container 设置为固定宽度,它不会适应。

改变这个:

.container-fluid{
    width: 800px;
    margin: 0 auto;
    padding-top: 2cm;

}

为此:

.container-fluid{
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding-top: 2cm;
}

并且它会适应屏幕直到达到 800px,然后就不会再扩展了。

我看到您在前端设计中使用了 Twitter bootstrap 框架,这使它变得非常简单。

只需尝试使用 bootstrap 列,它专为设备响应式设计而设计。

在 Bootstrap 网站上学习这部分 (Bootstrap Grids)

如果您实施它,您的网站将在所有设备上响应。 :)

如果是限制宽度的布局,你能不能只使用带前缀的 .container class,而不是 .container-fluid?