Comments (6)
Direct childs of elements with display:flex; (normaly only the flex containers are set to display:flex;) automaticaly become flex items.
Because .col (a flex item) itself is set to display:flex; its children automaticaly also become flex items.
An a-tag, normaly an inline element, becomes a block element when it is a flex item.
You can set the columns to
[class*="col"] {
display: initial;
}
if you don't need children of flex items automaticaly also become flex items.
Parent - display:flex; (flex container)
-- Child (automaticaly a flex item with display block)
---- Grandchild (normal element behavior)
Parent - display:flex; (flex container)
-- Child display:flex; (automaticaly a flex item with display block now also is a flex container)
---- Grandchild (now also automaticaly is a flex item with display block)
from flexboxgrid.
Thanks for clearing that up. If I use the first option:
Parent - display:flex; (flex container)
-- Child (automaticaly a flex item with display block)
---- Grandchild (normal element behavior)
Will it in anyway affect the grid system, nesting for example?
from flexboxgrid.
I don't think so. But I don't know exactly why .col is set to display:flex;. Take a look at the demo page where firstly every .col has a .box inside so you can avoid your a-tag problem. Secondly if you nest the grid in the demo every nested grid again has a .row.
from flexboxgrid.
Yes what @Aybee said. Thanks for helping to clear that up!
from flexboxgrid.
@kristoferjoseph
But why have you set .col to display:flex;? I think .cols only should be flex items and no flex containers. Can't you do it without that? Or are there some reasons you can't remember?
If I try the demo page without
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
on all .cols, then I can't find any difference. This all are properties which only belong to flex containers.
from flexboxgrid.
@Aybee the columns had display flex in order to allow you to add layout classes to a column. This was to support vertical layouts when not using a row. I didn't end up fleshing this out so possibly this could be added to a modifier class that enables column only layouts later on.
from flexboxgrid.
Related Issues (20)
- Why not using CSS Selector and text align classes ... HOT 6
- Mobile reorder Elements/row/columns HOT 2
- Building flexboxgrid from SCSS HOT 4
- Is there any way to resize columns width based on the element text length inside the columns or resize Column to fit it's contents? HOT 3
- Configure with Angular HOT 2
- -1rem negative margins right and left cause Safari to use scrollbars HOT 2
- About the container width.. HOT 1
- Is there anything Search function or sorting like Grid does? HOT 1
- Is Flexbox Grid interchangeable with Bootstrap 4's grid classes? HOT 5
- Project abandoned in 2019? HOT 6
- Repeated code HOT 1
- Use your codes for college's project?
- CDN link not workink
- Let's make flexboxgrid more discoverable HOT 1
- Is this library even maintained anymore? HOT 3
- Grid flexbox
- padding is different for class="col-md-6" and class="col-md-6 col-xs-6". Why?
- space-evenly
- You can reduce css size
- Would be great to have reverse by size
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flexboxgrid.