html - 如何使设计完全响应

标签 html css

滚动打开的页面。我想让页面看起来完全响应,没有任何滚动条。我尝试将高度设置为 100%,但没有成功。

html {
    height: 100%;
    width: 100%;
}
body{
width:100%;
hight:100%;
margin: 0;
padding:0;
}
.main{
    background-image: url("http://www.ghadaalsamman.com/new/images/bg.gif");
    background-repeat: no-repeat;
    background-position: center center;
    margin: 0;
padding-top: 30vw;
background-size: 100%;
}
.marquee {
    display: block;
    position: relative;

width: 51vw;
margin: auto;


}
marquee{
width: 100%;
margin: auto;
display: block;
}
#btn1 {
    background: url("http://www.ghadaalsamman.com/new/images/enter.gif") no-repeat scroll center center ;
    display: block;
    height: 53px;
    margin: 0 auto;
    position: relative;
    width: 50%;
background-size: 100%;
margin-top: 33%;
margin-bottom:1%;
}
.button {
    padding: 5px;
}
.container {
    display: block;
    height: 100%;
    margin: 0 auto;
    max-width: 960px;
    position: relative;
}


@media screen and (max-width:500px) {
    #btn1{
        background-size: 100% auto;
    }
}
<div class="main">
    <div class="container">
        <div class="marquee">
            <marquee scrollamount="3" direction="right" dir="ltr">
                 <h3 align="center" style="color:#804000;font-size:large;margin-top:0px;"><strong>  
    <img height="auto" width="200%" src="http://www.ghadaalsamman.com/new/images/image21.png">
        </strong></h3>

            </marquee>
        </div>
<a class="button" id="btn1" href="http://ghadaalsamman.com/new/site.html"></a>

    </div>
</div>

最佳答案

这就是问题所在

body {
    width: 100%;
    hight: 100%;  <----- 'hight' make it 'height'
    margin: 0;
    padding: 0;
}

替换成这个

body {
    width:100%;
    height:100%;
    margin: 0;
    padding:0;
}

关于html - 如何使设计完全响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24147963/

相关文章:

javascript - 如何使内部div溢出:scroll stay inside outer div?

javascript - cal-heatmap onclick onday,滚动到本周的部分

jquery - 如何使用 Jquery 设置 DIV 的绝对位置?

javascript - 我的值(value)不会文本对齐中心

html - Angular 内容不允许背景扩展

html - 如何为 div 分配固定的背景图像?

jquery - 想要在用户单击时更改 iPad 中的按钮图像

css - DIV布局 float 问题

html - 旋转的链接文本在 Firefox 中悬停时跳转

html - 在 HTML 中,是否可以插入一个自动换行提示?