-
-
Notifications
You must be signed in to change notification settings - Fork 79k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use display:inline-block instead of float #17915
Comments
I'm not sure I follow how |
Sorry , I can hardly attach the link. Here it goes: https://jsfiddle.net/prlopez/cqav24pw/ |
Hi @gthlopez! You appear to have posted a live example (https://fiddle.jshell.net/prlopez/cqav24pw/show/light/), which is always a good first step. However, according to Bootlint, your example has some Bootstrap usage errors, which might potentially be causing your issue:
You'll need to fix these errors and post a revised example before we can proceed further. (Please note that this is a fully automated comment.) |
Not a directional change we plan on taking. |
I see , I wonder where you saw problems about using display:inline -block. |
inline-block treats divs as text. So things like font size and letter spacing effect how far apart a display inline block is from one and another. Also things like different browsers and different OS's play an impact. You can over come this by doing things like Float is what you are suppose to use to put elements beside eachother, as states in the CSS documentation http://www.w3.org/TR/CSS2/visuren.html#float-position Also order matters when you use inline-block. You can't put a div on the left of another div and float that first div right. You would need to reorder them in HTML. You also couldn't do things like offset without the use of margins, which would effect the flow and make things like fluid width almost impossible. |
Closing per #17915 (comment) |
I know it's a year late, but I would like to point out one benefit to I have a list of search results displayed as grid of cards. On a large screen I wish to display rows of 3, and on a small screen I wish to display rows of 2. However the height of the card may change. Because the number of cards-per-row may change I can't do something cheesey like put
|
We've dropped nearly all our inline-block, table, and float styles for flexbox in v4. Should give you all the control you want :). |
@mdo I was about to complain about how flexbox still isn't the silver bullet everyone has been clinging to for two years, but then I took a look at Can I Use FlexBox and it looks like - at long last - it finally is. Guess my complaints are shot. Now I just need to know a convenient way to use Bootstrap 4's flexbox grid via NPM, if possible. I currently utilize Bootstrap like so:
Which is delightfully simple but doesn't yield the flexibility to change SCSS variables. Is there a |
You can override Sass variables with // Your override
$body-bg: blue;
// Our variables file
$body-bg: #fff !default;
// Code
body { background-color: blue; } |
This framework has been one of the best I have used , but I have a suggestion , you can use the property "display: inline-block " instead of "float: left | right and clear: both " that does exactly the same , " vertical-align : | middle | top bottom .... " only that the properties of vertical alignment is used , I 'd like to see in a later version . Thank you.
The text was updated successfully, but these errors were encountered: