How to change the width for the col-xs bootstrap?

青春壹個敷衍的年華 提交于 2020-06-02 03:54:10

问题


Hey I find nowhere if I can change the default value of col-xs-12

I tried to put that but I all broken...

.col-xs-12 {
	width: 600px;
}

If you are a doc where I can find the answer that will be really awesome !

Thx


回答1:


Never Change Bootstrap classes if you want to change any col- class simply add one more class on same element and style that class, and your external CSS file should be loaded after bootstrap, so the css file has effect Example:

<div class="col-xs-12 my-custom-width"></div>

<style>
    .my-custom-width{
       width:600px;
    }

</style>



回答2:


You can use it this way

<div style="max-width:"600px;margin:0 auto">
<div class="col-xs-12"></div>
</div>

OR with media queries

@media (max-width: 600px) { 
.col-xs-12{
max-width:600px !important;
}
} 


来源:https://stackoverflow.com/questions/43001106/how-to-change-the-width-for-the-col-xs-bootstrap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!