我有以下html-murkup结构:
<div class="wrapper">
<div class="my_line"></div>
</div>
包装纸有宽度1200 px
。我想让div.my_line
用户改变屏幕的比例时具有屏幕的宽度100%。我怎样才能做到这一点?我尝试使用background-repeat
,我是前端新手,有人可以帮我吗?
所以只是在这里猜测,但是您希望my_line div在屏幕达到1200px时拉伸100%的宽度吗?
如果是这样,您将使用以下代码:
/* Check the screen width, in this case looking for the screen to reach 1200px or below. Then extend the my_line div to 100% */
@media (max-width: 1200px) {
.wrapper .my_line {
width: 100%;
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句