[v4] Why are all col classes 'position: relative'?
See original GitHub issueIs there a reason for making all columns relative?
Typically I wrap my rows and cols inside ‘sections’ which have their own padding top and bottom. I sometimes choose to make elements inside those columns stick absolutely to the edges of the section. With cols as relative now, it’s less trivial to do so.
Applying an override of…
[class*='col'] {
position: static;
}
does the trick, and I can’t seem to find any drawbacks. Although I’m wondering if there’s a good reason for relative in the first place? Please correct me if I’m wrong or missing something.
Cheers!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:10
- Comments:21 (10 by maintainers)
Top Results From Across the Web
Position - Bootstrap
Position an element at the top of the viewport, from edge to edge. Be sure you understand the ramifications of fixed position in...
Read more >Bootstrap grid-system is always in front - Stack Overflow
position: relative is necessary in Bootstrap for when you need to rearrange columns. This is accomplished by using col-sm-push-4 or similar ...
Read more >position - CSS: Cascading Style Sheets - MDN Web Docs
The element is removed from the normal document flow, and no space is created for the element in the page layout. It is...
Read more >Selectors Level 4 - W3C
E:nth-col( n ), an E element that represents a cell belonging to ... Like all CSS keywords, pseudo-class names are ASCII case-insensitive.
Read more >CSS Layout - The position Property - W3Schools
An element with position: absolute; is positioned relative to the nearest positioned ancestor (instead of positioned relative to the viewport, like fixed).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yup, agreed.
We’ll be dropping the relative from columns in v5, just need to make sure we’re considering the change to other components as mentioned in my last comment. ❤️
PR opened: #25255.