简体   繁体   中英

change div width using media queries when window resize

I would like to write a media query to set a different width for a div when resizing the browser. I want this to do because my bootstrap not gonna work as intended. Any help ?

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 */
}

I want this to happen when browser width is less than 600px.

@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 */
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM