在Laravel中应用Bootstrap之后,页面已经装箱了

I have two divs on this page, the second div has an iframe in it. It looks, works, feels fine, however, after applying bootstrap css and js, the whole page gets a wrapped look, and everything is stuffed into the middle (see pics attached.) Maybe my other css file has something to do with it?

My css:

* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

html,body,.container {
    height:100%;
}

body {
    margin: 0;
    background: #f7f7f7;
    color: #363636;
    font-family: 'Source Sans Pro', 'Helvetica', 'Arial', sans-serif;
    font-size: 16px;
    line-height: 1.42857143;
}

.logo {
    display: block;
    margin: 30px auto;
}

.form {
    max-width: 400px;
    padding: 20px;
    margin: 30px auto;
}

.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
}

.form-control {
    margin: 0;
    display: block;
    width: 100%;
    height: 36px;
    padding: 6px 12px;
    font-size: 16px;
    line-height: 1.42857143;
    color: #363636;
    background-color: #ffffff;
    background-image: none;
    border: 1px solid #cccccc;
    border-radius: 0;
    -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
    -o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
    transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}

.btn {
    display: block;
    width: 100%;
    margin-bottom: 0;
    font-weight: normal;
    text-align: center;
    vertical-align: middle;
    touch-action: manipulation;
    cursor: pointer;
    white-space: nowrap;
    padding: 9px 22px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    color: #ffffff;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
    background-image: none;
    border: 0;
    height: 50px;
    font-size: 20px;
    line-height: 1.3333333;
    border-radius: 0;
    font-weight: 700;
    -webkit-transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    -o-transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn:focus {outline: 0;}
.btn:hover {background-color: #398023;}
.btn:active {
    outline: 0;
    background-image: none;
    -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    -webkit-transform: scale(0.95);
    -ms-transform: scale(0.95);
    -o-transform: scale(0.95);
    transform: scale(0.95);
}

/* Zebra
.btn {background-color: #00a66e;}*/

/* EASI'R */
/*.btn {background-color: #81c074;}*/

/* Skoda */
.btn {background-color: #4ba82e;}

.contentbar {
    /*border: 1px solid red;*/
    width: 100%;
    height: 110px;
}

.mainContent {
    border: 1px solid gray;
    width:100%;
    height:100%;
}

.mainContent iframe {
    /*border: 1px solid green;*/
    width:100%;
    height: 100%;
    /*height:calc(100% - 150px);*/
}

I use the following to apply bootstrap:

<link rel="stylesheet" type="text/css" href="/css/bootstrap/bootstrap.css">
<script src="/js/bootstrap/bootstrap.js"></script>

See here my attached before and after pics. Thanks![enter image description here

enter image description here

dongxian3418
dongxian3418 你应该使用容器-液体而不是容器
2 年多之前 回复

1个回答



你可能在html中使用带有“容器”类的div,这就是为什么一切都将成为中心。</ p>
</ div >

展开原文

原文

you might using a div with class "container" in html that's why everything is coming center.

duande1985
duande1985 额外的!important属性不起作用,所以我只是将容器的div名称改为其他东西,这就是诀窍。 应该早点想到这个。 无论如何,感谢@Zaheer Abbas的暗示!
2 年多之前 回复
douchungu0859
douchungu0859 你可以做css as .container {width:100%!important;}它会覆盖bootstrap的css。
2 年多之前 回复
dozr162106
dozr162106 是的,但遗憾的是它在禁用它后仍然看起来一样:(
2 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐