html - Bootstrap col's aren't collapsing at breakpoint as expected -


bootstrap 3.3.7

i have following markup:

 <div class="homepage-casestudy container-fluid mt-25">     <div class="row">         <div class="col-md-8" style="border:1px solid green;">             <div class="container">                 <div class="row">                     <div class="col-md-6 col-md-push-4 homepage-casestudy__text" style="border:1px solid orange;">                         <h4>case study</h4>                         <h3>lorem ipsum dolor sit amet, consectetur adipiscing elit, sed eiusmod tempor incididunt</h3>                         <a href="#" class="btn btn-primary btn-lg">read</a>                         <a href="#" class="btn btn-lg btn-default">see all</a>                     </div>                 </div>             </div>            </div>          <div class="col-md-4 hidden-sm hidden-xs" style="padding:0; border:1px solid red;">             <img src="http://via.placeholder.com/1037x615" style="max-height: 300px" class="pull-right">         </div>     </div> </div> 

jsfiddle here https://jsfiddle.net/0wu3vt2d/1/

the effect i'm trying create have .container-fluid contains right aligned image (which seems work ok). on left of image there text , buttons in .container.

when it's on medium/large (.md-, .lg-) viewports works ok, such this:

enter image description here

but when collapses mobile viewport, image starts "overlap" text, e.g. enter image description here

i don't understand why happening because .col-md-8 , .col-md-4 add "12 columns" bootstrap collapses them on smaller viewports?

i want hide image - seems work using .hidden-sm, .hidden-xs - on smaller screens. seems work ok. still looks odd when resizing browser window.

what have done wrong?

i believe after: https://jsfiddle.net/0wu3vt2d/2/

you getting pull/push mixed offset , causing problems.

the attached fiddle changes classes be:

col-sm-offset-4 col-md-6 col-md-offset-0 homepage-casestudy__text

which means on small screens has grid offset of 4 , on big screens has no offset, can tweaked accordingly of course liking believe achieves wanted.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -