I have an unordered list that I want balanced across the page. So I applied the Bootstrap column balancing technique as shown in this sample. The real items have rather long
The grid works with 3 parts: a container, a row and column(s)...
The container has 15px of padding. The row negates the container padding with -15px of margin. Columns have 15px of padding, which pull the content away from the edges of the container and create a consistent 30px gutter.
The purpose for adding 15px of padding that is only negated by the negative row margins seems silly, but it is essential to allow for nesting columns inside of other columns! Note in the diagram below how the nested columns indicated by the red outline fits neatly into the enclosing column without getting additional padding applied.
What's screwing you up is that column widths are all designed to be percentages. So, in your example, on medium width viewport, the columns are set to 50%. When you add 1em of margin to the li.col-md-6 it ADDs that on top of the 50% which means you wind up with 100% + 2em on the row and causes the column to wrap.
Make sense?
I guess you have a "fix" but, another way to handle this and retain the visual bullets and the single unordered list (which could be important for accessibility), plus still have all of the nesting capabilities preserved, I would do the following in your css instead:
li.col-lg-12, li.col-md-6 {
list-style: none;
padding-left: 30px;
}
li.col-lg-12:before, li.col-md-6:before {
content: "\2022";
position: absolute;
left: 15px;
}
This way you don't need to add any additional markup to your design. Basically what this does is remove the list-style, add 30px of additional padding to the list item and then places the bullet with the pseudo class :before
15px to the left of the content inside the column where the content would normally be aligned anyway.
EDIT: Here's my experience with the two different approaches.
This is what I got when I tried your approach. Notice how the bullet from the second column is encroaching on the text and padding from the first column.
Using my approach, I was able to achieve this:
To me, I would favor this approach because it behaves better in the sense that the bullets are enclosed within the column. Additionally, in my mind, this seems less complicated because it doesn't involve any extra markup. In your case, you had added the style inline, which I always avoid for maintainability reasons. And, while you could write a rule in your stylesheet to override the .row class behavior, you would then lose that nice clean nesting I described above when you didn't want to use the column classes on a list item. Of course, you could add another class or id to your row to provide more specificity, but again, to me, that's more markup, and it's not standard Bootstrap so it can be harder for someone else to maintain later on (or if you're like me and you forget all of your hacks in a week, it might even be harder for you to maintain ;-).