Bootstrap Lining Up Form Elements - html

I have created a Bootply to show the issue I am having: http://www.bootply.com/8fPmr31Wd7
Scroll down to look at "People" and "Places" and find they are indented along the sides.
Perhaps I am not using the right classes, or perhaps there is a bug with the grid, but if you use the grid commands within a form, it causes the elements that are within a grid to be just a hair off on each side and not line up properly with the rest of the form.
I know Bootstrap 4 is in testing, but I didn't know if this was a bug or something I am missing so I thought I'd ask. Thank you.

You have grid rows that don't contain any columns for all your other form rows, and you're using columns for the People and Places form element groups.
If you add a 12-unit wide column within your other rows, as per the top answer to Best practice for single column within row in bootstrap v3 grid system?, your horizontal spacing within your grid will be consistent.

Related

HTML & Bootstrap 4: Dynamically move a card element from one column to another

I am working on an interface for a Raspberry Pi based embedded device. The interface is built with Bootstrap 4 and is currently centered around a .navbar at the top and a .row > .col structure with just two columns within the row. Within each column there are multiple cards. Depending on the user actions and enabled features, there are one or two cards that won't be rendered and the others can change in height.
My current issue is that upon a specific user action, a new card will be added to the first column thus pushing the other cards down the page and some out of view. When this happens, I want one or two of those "out-of-view" cards to then instead show up in the second column.
I can't seem to figure out a good solution to this problem. I want to keep the two columns (at least in visuals) and dynamically assign the various card elements to one column or the other.
If I leave the current structure of .row > .col then each of the card elements are static within each column via the HTML thus short of putting the card in the DOM twice and hiding one or the other, I need a different solution.
If I rebuild the page to use flex-box instead and rely on wrapping, I run into issues where one card will be larger than the other within the row causing a bunch of empty space to show up. That is before I even try changing the order of each card. On to the next solution.
Trying the grid system, I can get something close to what I am looking for but it isn't perfect. The cards move from one column to the next by adjusting grid-template-areas. Since there are cards of different heights (and can change during use), I have some cards spanning multiple rows so there isn't any empty vertical space between cards in a given column or vertical growth to any cards beyond its internal content. This works fine for one given combination of card order and heights, but doesn't for others; I run into the same problem as with the flex-box with empty space within one column for a given row.
I want this to be mainly HTML and CSS driven in order to keep the javascript to a minimum. I figure that I would add some functions to call when various user actions happen (such as with changing the grid-template-areas), it is just a matter of figuring out what HTML and CSS combo to use before writing the necessary JS.
Is there something I am missing with the solutions I have tried so far? Is there other solutions I have overlooked? Do I just need to use JS to essentially "cut" the entire card HTML code block from one column and "paste" it into the other column? Any insight or direction to another solution I can look into is appreciated!
Here are some visuals:
Initial layout:
After that, the user could cause card 2 to pop up which pushes card 3 and 4 out of view:
When that happens, I want card 4 to show up in the second column:
When using the grid system, due to how the various cards can change in height, I have not been able to find a way to size the rows dynamically enough to correct these anomalies (growth if the height is not capped, or empty space if it is):

CSS/ HTML Empty Space issue with Div alignment

i have a Commercial Website Called Akaratak
In the Search Page in Mobile mode (after resizing the browser to the minimum)
there is a space left empty between some divs
as follows:
i know it must be a simple question but i couldn't get it to get aligned
As i can see you are using Bootstrap, but not in a proper way. You should change your layout to a 4 or 6 column one so the grid will auto adjust to a 2x2 layout as you want it.
Another thing that you can do is to make your layour like:
2x2
-1-
2x2
Using bootstrap classes you just need to add one class to the third object of each row making it sm-12 and the others sm-6. I suggest you to read more carefully Bootstrap grid system to use it the right way.
Instead you can use Bootstrap 4 grid system witch allow you to move and workaround your problem in a nice way.
You should remove the <div class="clearfix"></div> child on every <div class="deal-top-top"></div> parent :)

Grid System with Automatic Nested Columns

I'm working on a site that has on the homepage various blocks of information. I've been using Bootstrap for the grid, but when a column is taller than the previous one, it creates an entirely new row, leaving empty space in the columns, like so:
I know I can remove the space by nesting 2 and 4 in the same column div, but it would be far better for the project if the grid system would automatically nest the columns, like so:
Is there a grid system that can do this for me?
Update:
Thanks for the Bootstrap cards link, but what I'm looking for is something that specifically puts the first items up top, so that my users can put the most important blocks first, and have those at the top of the page.

How to make layout like notes in Google Keep using CSS?

I'm making blog template. In article/post list, i want to create layout like this, i don't know what name this layout, it's like notes in android version of Google Keep
I try to create the layout using simple box div with css float:left but the result is like this, there is a leave blank space when box change line, and the next box start horizontally in new line
So, is anyone knows how to make layout like that without using two column of div? or maybe there is any javascript plugin to solve?
This is a javascript solution, but have you thought of using something like Isotope or Masonry? http://isotope.metafizzy.co/
So, is anyone knows how to make layout like that without using two column of div?
It's a bit of feature abuse, but you can set the outer div to use text columns and then layout the inner divs in 2 columns with display: inline-block.
Column direction flexboxes won't fill the horizontal space automatically even if you allow them break because they only break if they are somehow constrained in that direction and height usually is not constrained in documents.

Multi row column in 960 grid system

I need to make a page which makes use of the 960 grid system which has a multi-row column. What I mean is I have three columns in a 16 column separated into 3-10-3 but on the last column, I need to make several divs for news feed, ads and also a "follow us on..." box which will all be aligned vertically. Refer to the picture for a visual pov.
Is there a way to this on 960gs? It seems like I can just pile divs of equal width in the column but I don't know. Help please
I've got it, turns out instead of using more divs with 'grid_x' classes within a grid column, you can just use normal divs with no classes and it will automatically align to the parent div.