Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap, can you disable display flex?

I have the following css thats breaking my layouts:

@media (min-width: 768px)
.row {
    display: flex;
}

Can I disable the display flex rule? Can anyone explain why this happens?

Update:

Currently using boostrap-sass, "bootstrap-sass": "~3.3.5" Cant find the line in my sass files, probably not much help but it appears here in my compiled css:

strong {
  font-weight: 600; }

.wrapper {
 padding: 50px 20px; }

 // row class here

**@media (min-width: 768px) {
  .row {
  display: flex; } }**

@media (min-width: 768px) {
  .column {
width: 50%; }
.column:first-child {
margin-right: 20px; } }

.modal__button {
 margin-right: 5px; }

@media (max-width: 500px) {
 .modal-dialog {
width: 100%;
margin: 10px auto; } }

.week-navigation {
  float: right; }

 .week-navigation__next-button {
  float: right; }
like image 456
Bomber Avatar asked Jan 29 '16 14:01

Bomber


People also ask

How do I block display flex?

You can add a big margin-right and use flew wrap on the container (as an alternative to the common solution using width:100% or flex:0 0 100% ). With this solution you can also specify a width and other element will always go to the next row (like we do with a block element).

How do I get rid of flex stretch?

If you want to unstretch a single flex-item on the container, you have to set align-self: flex-start; to this flex-item. All other flex-items of the container aren't affected.

What is the purpose of display flex?

The flex property sets the flexible length on flexible items. Note: If the element is not a flexible item, the flex property has no effect.

What happens when you set display to flex?

As soon as you set the display property to flex, the unordered list automatically becomes the flex container and the child elements (in this case, the list elements li ) become flex items. These terms would come up over and over again as I walk you through some more interesting things the Flexbox model has in place.


2 Answers

CSS display property has several possible values. One of them, and the most recent, is flex. A HTML element with flex will automatically apply default properties to its children elements. You can check the following url to understand how flex works https://css-tricks.com/snippets/css/a-guide-to-flexbox/ So, if you don't want to use it, just override it, by using

@media (min-width: 768px)
.row {
    display: block;
}

for example.

like image 95
Joao Almeida Avatar answered Sep 19 '22 08:09

Joao Almeida


Can you tell me a little more about where this following block of CSS is located? What version of bootstrap are you running as well? It may be something as simple as changing a boolean from true to false and then recompiling the SCSS that bootstrap 4 (assuming that is the version you are using) provides.

If you are using an older version of bootstrap, then you have a library, or CSS you wrote yourself that is overwriting. I am leaning that your issue is being caused by the prior assumption.


If you have SASS installed on your computer already and are familiar with it as well, then this is easy. Locate the _variables.scss file that is included with bootstrap and inside of it you will find the following property:

$enable-flex: true !default;

You want to change this to:

$enable-flex: false !default;

After you have done this, recompile bootstraps the SCSS and you will then have disabled flex throughout the entire bootstrap framework.

like image 31
Dmidify Avatar answered Sep 18 '22 08:09

Dmidify