Pages

Showing posts with label Bootstrap. Show all posts
Showing posts with label Bootstrap. Show all posts

bootstrap 4 get remaining height of parent div

bootstrap 4 get remaining height of parent div



       <div class="row h-100 flex-column">
        <div class="row">
          <div>
            <div>ROWccccccccccc 1</div>
          </div>
        </div>
        <div class="row justify-content-center align-items-center bg-blue flex-grow-1">
          <div class="text-white">ROWcccccccccccccc 2</div>
        </div>
      </div>


<div class="container-fluid h-100">
  <div class="row justify-content-center h-100">
    <div class="col-4 bg-red">
      <div class="h-100 d-flex flex-column">
        <div class="row justify-content-center bg-purple">
          <div class="text-white">
            <div style="height:200px">ROW 1</div>
          </div>
        </div>
        <div class="row justify-content-center bg-blue flex-grow-1">
          <div class="text-white">ROW 2</div>
        </div>
      </div>
    </div>
    <div class="col-8 bg-gray">grgrgrg</div>
  </div>
</div>

Link - https://codepen.io/anon/pen/RyQvmW?editors=1100

Bootstap 4 hide md and below - Hide in medium screen and below

Reference URL

https://stackoverflow.com/questions/35351353/missing-visible-and-hidden-in-bootstrap-v4

Show/hide for breakpoint and down:
  • hidden-xs-down (hidden-xs) = d-none d-sm-block
  • hidden-sm-down (hidden-sm hidden-xs) = d-none d-md-block
  • hidden-md-down (hidden-md hidden-sm hidden-xs) = d-none d-lg-block
  • hidden-lg-down = d-none d-xl-block
  • hidden-xl-down (n/a 3.x) = d-none (same as hidden)
Show/hide for breakpoint and up:
  • hidden-xs-up = d-none (same as hidden)
  • hidden-sm-up = d-sm-none
  • hidden-md-up = d-md-none
  • hidden-lg-up = d-lg-none
  • hidden-xl-up (n/a 3.x) = d-xl-none
Show/hide only for a single breakpoint:
  • hidden-xs (only) = d-none d-sm-block (same as hidden-xs-down)
  • hidden-sm (only) = d-block d-sm-none d-md-block
  • hidden-md (only) = d-block d-md-none d-lg-block
  • hidden-lg (only) = d-block d-lg-none d-xl-block
  • hidden-xl (n/a 3.x) = d-block d-xl-none
  • visible-xs (only) = d-block d-sm-none
  • visible-sm (only) = d-none d-sm-block d-md-none
  • visible-md (only) = d-none d-md-block d-lg-none
  • visible-lg (only) = d-none d-lg-block d-xl-none
  • visible-xl (n/a 3.x) = d-none d-xl-block

bootstrap change active tab on page reload

  <script>
  $('.nav-tabs-custom a').click(function(e) {
  e.preventDefault();
  $(this).tab('show');
});

// store the currently selected tab in the hash value
$("ul.nav-tabs > li > a").on("shown.bs.tab", function(e) {
  var id = $(e.target).attr("href").substr(1);
  window.location.hash = id;
});

// on load of the page: switch to the currently selected tab
var hash = window.location.hash;
$('.nav-tabs-custom a[href="' + hash + '"]').tab('show');
  </script>

Search This Blog