Bootstrap Column Stack for xs

Richard Korts
Richard Korts used Ask the Experts™
on
Please look at http://rkassoc.org/Lakos_config/base_template.php. This is precisely what I want. However, as it gets narrower, it stacks the columns in an odd way. See attached, it looks like it breaks on the image boundaries, not the column boundaries. Attached is "narrow" view & source.

What I want is in the narrow (xs) view, the columns with the circled numbers & connecting lines to stack vertically.

How can I do this?

Is this partially caused by my own css to force no column padding?

Thanks
base_template.php
narrow.jpg
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
RobOwner (Aidellio)
Most Valuable Expert 2015

Commented:
See here for a demo: http://jsbin.com/neyosakoyu/edit?html,output

I"ve also rotated the line image 90deg for when it is in "xs" mode

Essentially I've added a section for what is visible at "xs" and for larger screens.

    <div class="container-fluid">
      <div class="row">
        <div class="hidden-xs">
          <div class="col-sm-6 col-xs-6 text-right nopadding"><img src="http://rkassoc.org/Lakos_config/images/1_blue.png"><img src="http://rkassoc.org/Lakos_config/images/line_60.png"><img src="http://rkassoc.org/Lakos_config/images/2_blue.png"><img src="http://rkassoc.org/Lakos_config/images/line_60.png"><img src="http://rkassoc.org/Lakos_config/images/3_blue.png"><img src="http://rkassoc.org/Lakos_config/images/line_60.png"></div>
          <div class="col-sm-6 col-xs-6 nopadding"><img src="http://rkassoc.org/Lakos_config/images/4_blue.png"><img src="http://rkassoc.org/Lakos_config/images/line_60.png"><img src="http://rkassoc.org/Lakos_config/images/5_blue.png"><img src="http://rkassoc.org/Lakos_config/images/line_60.png"><img src="http://rkassoc.org/Lakos_config/images/6_blue.png">
          </div>
        </div>
        <div class="visible-xs">
          <div class="nopadding"><img src="http://rkassoc.org/Lakos_config/images/1_blue.png"></div>

          <div class="nopadding"><img src="http://rkassoc.org/Lakos_config/images/line_60.png"></div>
          <div class="nopadding"><img src="http://rkassoc.org/Lakos_config/images/2_blue.png"></div>
          <div class="nopadding"><img src="http://rkassoc.org/Lakos_config/images/line_60.png"></div>
          <div class="nopadding"><img src="http://rkassoc.org/Lakos_config/images/3_blue.png"></div>
          <div class="nopadding"><img src="http://rkassoc.org/Lakos_config/images/line_60.png"></div>
          <div class="nopadding"><img src="http://rkassoc.org/Lakos_config/images/4_blue.png"></div>
          <div class="nopadding"><img src="http://rkassoc.org/Lakos_config/images/line_60.png"></div>
          <div class="nopadding"><img src="http://rkassoc.org/Lakos_config/images/5_blue.png"></div>
          <div class="nopadding"><img src="http://rkassoc.org/Lakos_config/images/line_60.png"></div>
          <div class="nopadding"><img src="http://rkassoc.org/Lakos_config/images/6_blue.png"></div>


        </div>
      </div>
    </div>

Open in new window


CSS
.hidden-xs .nopadding {
  padding: 0 !important;
  margin: 0 !important;
}
.visible-xs .nopadding {
  padding: 5px !important;
  margin: 0 !important;
  text-align: center;  
}
.visible-xs img[src*=line] {
  -ms-transform: rotate(90deg); /* IE 9 */
  -webkit-transform: rotate(90deg); /* Chrome, Safari, Opera */
  transform: rotate(90deg);
}

Open in new window

Richard KortsBusiness Owner / Chief Developer

Author

Commented:
Rob,

Thanks for your response.

Your solution gives the attached called rob.jpg

What I want is like the attached stacked.jpg. Ignore the shading imperfections. Either that or with the line before the 4 or BEST, the line between 3 & 4 removed.. But I can live with the line. I don;t want to have to get into specialized if - then - else depending upon device width.

Thanks

Thanks.
rob.jpg
stacked.jpg
Richard KortsBusiness Owner / Chief Developer

Author

Commented:
Rob,

You can view my version at rkassoc.org/Lakos_config/base_template_rob.php

Thanks
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Owner (Aidellio)
Most Valuable Expert 2015
Commented:
Hi Richard,

Sorry about the confusion, hopefully this works better for you: http://jsbin.com/hurizelivu/edit?html,css

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>JS Bin</title>
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
  </head>
  <body>
    <div class="container-fluid">
      <div class="row">
        <div class="col-xs-12 col-sm-6 text-right-sm text-left-xs nopadding">
          <img src="http://rkassoc.org/Lakos_config/images/1_blue.png"><img src="http://rkassoc.org/Lakos_config/images/line_60.png"><img src="http://rkassoc.org/Lakos_config/images/2_blue.png"><img src="http://rkassoc.org/Lakos_config/images/line_60.png"><img src="http://rkassoc.org/Lakos_config/images/3_blue.png"><img src="http://rkassoc.org/Lakos_config/images/line_60.png">
        </div>
        <div class="col-xs-12 col-sm-6 nopadding">
          <img src="http://rkassoc.org/Lakos_config/images/4_blue.png"><img src="http://rkassoc.org/Lakos_config/images/line_60.png"><img src="http://rkassoc.org/Lakos_config/images/5_blue.png"><img src="http://rkassoc.org/Lakos_config/images/line_60.png"><img src="http://rkassoc.org/Lakos_config/images/6_blue.png">
        </div>
      </div>
    </div>
  </body>
</html>

Open in new window

css
.nopadding {
  padding: 0 !important;
  margin: 0 !important;
}

.text-left-not-xs, .text-left-not-sm, .text-left-not-md, .text-left-not-lg {
    text-align: left;
}
.text-center-not-xs, .text-center-not-sm, .text-center-not-md, .text-center-not-lg {
    text-align: center;
}
.text-right-not-xs, .text-right-not-sm, .text-right-not-md, .text-right-not-lg {
    text-align: right;
}
.text-justify-not-xs, .text-justify-not-sm, .text-justify-not-md, .text-justify-not-lg {
    text-align: justify;
}

@media (max-width: 767px) {
    .text-left-not-xs, .text-center-not-xs, .text-right-not-xs, .text-justify-not-xs {
        text-align: inherit;
    }
    .text-left-xs {
        text-align: left;
    }
    .text-center-xs {
        text-align: center;
    }
    .text-right-xs {
        text-align: right;
    }
    .text-justify-xs {
        text-align: justify;
    }
}
@media (min-width: 768px) and (max-width: 991px) {
    .text-left-not-sm, .text-center-not-sm, .text-right-not-sm, .text-justify-not-sm {
        text-align: inherit;
    }
    .text-left-sm {
        text-align: left;
    }
    .text-center-sm {
        text-align: center;
    }
    .text-right-sm {
        text-align: right;
    }
    .text-justify-sm {
        text-align: justify;
    }
}
@media (min-width: 992px) and (max-width: 1199px) {
    .text-left-not-md, .text-center-not-md, .text-right-not-md, .text-justify-not-md {
        text-align: inherit;
    }
    .text-left-md {
        text-align: left;
    }
    .text-center-md {
        text-align: center;
    }
    .text-right-md {
        text-align: right;
    }
    .text-justify-md {
        text-align: justify;
    }
}
@media (min-width: 1200px) {
    .text-left-not-lg, .text-center-not-lg, .text-right-not-lg, .text-justify-not-lg {
        text-align: inherit;
    }
    .text-left-lg {
        text-align: left;
    }
    .text-center-lg {
        text-align: center;
    }
    .text-right-lg {
        text-align: right;
    }
    .text-justify-lg {
        text-align: justify;
    }
}

Open in new window

Richard KortsBusiness Owner / Chief Developer

Author

Commented:
Rob,

I must be doing something wrong, I get the attached at wide & narrow widths.

This is in Firefox, http://rkassoc.org/Lakos_config/base_template_rob.php

But lets forget it, I am going with the approach as manifested in the other question about the font sizes.
rob_large_size.jpg
rob_narrow_size.jpg
Richard KortsBusiness Owner / Chief Developer

Author

Commented:
Thanks for your efforts!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial