在 window 调整大小时使用媒体查询更改 div 宽度
change div width using media queries when window resize
我想编写一个媒体查询,以便在调整浏览器大小时为 div 设置不同的宽度。我想要这样做是因为我的 bootstrap 不会按预期工作。有什么帮助吗?
html :
<div class = "column2 col-sm-10 col-xs-10">
<ng-view> Loading.. </ng-view>
</div>
CSS:
.column2
{
width: 450px;
float: left;
background-color: white;
height: 535px;
border-radius: 5px;
margin-top: 30px;
overflow-y: auto; /* Makes the scrollbar appear when it should be scrollable */
}
我希望在浏览器宽度小于 600 像素时发生这种情况。
@media screen and (max-width: 600px) {
.column2
{
width: 450px;
float: left;
background-color: white;
height: 535px;
border-radius: 5px;
margin-top: 30px;
overflow-y: auto; /* Makes the scrollbar appear when it should be scrollable */
}
}
@media screen and (max-width:600px) {
.column2
{
width: 450px;
float: left;
background-color: white;
height: 535px;
border-radius: 5px;
margin-top: 30px;
overflow-y: auto; /* Makes the scrollbar appear when it should be scrollable */
}
}
我想编写一个媒体查询,以便在调整浏览器大小时为 div 设置不同的宽度。我想要这样做是因为我的 bootstrap 不会按预期工作。有什么帮助吗?
html :
<div class = "column2 col-sm-10 col-xs-10">
<ng-view> Loading.. </ng-view>
</div>
CSS:
.column2
{
width: 450px;
float: left;
background-color: white;
height: 535px;
border-radius: 5px;
margin-top: 30px;
overflow-y: auto; /* Makes the scrollbar appear when it should be scrollable */
}
我希望在浏览器宽度小于 600 像素时发生这种情况。
@media screen and (max-width: 600px) {
.column2
{
width: 450px;
float: left;
background-color: white;
height: 535px;
border-radius: 5px;
margin-top: 30px;
overflow-y: auto; /* Makes the scrollbar appear when it should be scrollable */
}
}
@media screen and (max-width:600px) {
.column2
{
width: 450px;
float: left;
background-color: white;
height: 535px;
border-radius: 5px;
margin-top: 30px;
overflow-y: auto; /* Makes the scrollbar appear when it should be scrollable */
}
}