html让div宽度等于页面宽度,html – 使div为浏览器窗口的100%宽度

我正试图让我的一个容器100%的屏幕宽度.

这是我的SASS

body, html {

width: 100%;

height: 100%;

padding: 0;

margin: 0;

}

#neo_wrapper {

width: 960px;

height: 1500px;

margin: 0 auto;

#neo_main_container1 { /* Slide1 container */

width: 100%;

height: 100%;

margin: 0 auto;

background: #999999;

z-index: 350;

#neo_scroll_button { /* Div that enables scroll */

position: absolute;

bottom: 35px;

left: 0;

right: 0;

margin: 0 auto;

width: 150px;

height: 15px;

background: #F00;

color: #FFF;

text-align: center;

line-height: 15px;

display: table;

a {

&:link {text-decoration: none; color: #FFF;}

&:visited {text-decoration: none; color: #FFF;}

}

}

}

#neo_main_container2 {

width: 100%;

height: 100%;

margin: 0 auto;

background: #CCC;

z-index: 300;

#neo_img_container {

float: left;

width: 350px;

height: 500px;

margin: 0 auto;

margin-right: 15px;

}

#neo_text_container {

float: left;

width: 50%;

height: 500px;

margin: 0 auto;

}

}

}

和HTML

Enter

?t=px&w=350&h=250&bg=0ff&fg=000000

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

我希望#neo_main_container1成为屏幕的全宽.显然因为它是#neo_wrapper的孩子,将宽度设置为100%将使其成为960px.我确定如何规避这个问题,所以任何帮助都会受到赞赏.

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值