html - How do you force a column div to be the same height of its row? -
this question has answer here:
- how can make bootstrap columns same height? 28 answers
i'm in process of learning bootstrap , struggling hard. know default row height in bootstrap whatever height able contain child element (i.e. column). however, default height of column take minimum amount of space.
so question: how force height of column take height of row? let's have 2 columns in row. height of 1 column greater other due contents of column being more. how force sibling column same height?
i feel i've tried , having no luck. i've tried using flex properties, table properties, nothing working.
also, practice me modifying css of bootstrap classes? couldn't possibly break entire framework?
tldr: best method declaring div heights in bootstrap?
as example, how both of 'hello there' divs occupy same height in same row?
<!doctype html> <html lang="en"> <head> <title>coffeedev data dashboard</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <style> body { padding-top: 70px;} .col-md-9{height: 100%} </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/2.1.4/chart.bundle.js"></script> <script src="https://cdn.plot.ly/plotly-latest.min.js"></script> </head> <body> <!-- fixed navbar --> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#">coffeedev dashboard</a> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="#">home</a></li> <li><a href="#plot">plot</a></li> </ul> </div> </div> </nav> <!-- main container --> <div class="container-fluid "> <div class="row"> <div class="col-md-3"> <div class="alert alert-success" role="alert"> <h3> hello there!</h3> <br> <br> <br> <br> </div> </div> <div class="col-md-9"> <div class="alert alert-success" role="alert"> <h3> hello there!</h3> </div> </div> </div> <div class="row"> <div class="col-md-12"> hi there! </div> </div> </div> </body> </html>
edit: attempting .row-eq-height. still no luck.
<!doctype html> <html lang="en"> <head> <title>coffeedev data dashboard</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <style> body { padding-top: 70px;} </style> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/2.1.4/chart.bundle.js"></script> <script src="https://cdn.plot.ly/plotly-latest.min.js"></script> </head> <body> <!-- fixed navbar --> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#">coffeedev dashboard</a> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="#">home</a></li> <li><a href="#plot">plot</a></li> </ul> </div> </div> </nav> <!-- main container --> <div class="container-fluid "> <div class="row row-eq-height"> <div class="col-md-3" style="background-color: red"> hello! <br> <br> <br> </div> <div class="col-md-9" style="background-color: red"> hello! </div> </div> </div> </body> </html>
if wand control height can specify height in own css like;
#mycustomdivid{ height: 10em; }
em scale screen size. playing number until looks way want.
Comments
Post a Comment