I have two full height columns in bootstrap where I want to render a bunch of panels in the right column. (used this So thread for full height columns answer from AndreDurao) I don't want the whole page to scroll when I have a large number of panels so I make the panels parent container element scrollable, but when I try to set the height to 100%, so that the panels scroll but not the whole page, it doesn't work right in IE! It works great in Chrome (just the inner div scrolls), but in IE the whole page scrolls. Why is it different between the 2 browsers and can this be fixed?
FYI - I tried overflow-y: auto but that didn't work either. And I can see the scroll bar for the panels div but it's greyed out like it's disabled. Using IE 11 and it looks like Edge has the same problem/bug!
Here is my bootply and my code
html, body {
height: 100%;
/*border: 1px solid red;*/
}
.table-container {
height: calc(100% - 53px);
/*border: 1px solid green;*/
}
nav.navbar {
margin: 0;
}
.table-container {
display: table;
width: 100%;
padding-left: 0px;
padding-right: 0px;
}
.table-container .table-row {
height: 100%;
display: table-row;
}
.table-container .table-row .table-col {
display: table-cell;
float: none;
vertical-align: top;
}
#eventsContainer {
height: 100%;
}
<div class="container table-container">
<div class="row table-row">
<div class="col-sm-6 table-col"></div>
<div class="col-sm-6 table-col" style="border: 1px solid red;">
<div id="eventsContainer" style="overflow-y: scroll;">
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
</div>
</div>
</div>
</div>
Try this:
Check Demo Here
HTML:
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Brand</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active">Link <span class="sr-only">(current)</span></li>
<li>Link</li>
<li class="dropdown">
Dropdown <span class="caret"></span>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li role="separator" class="divider"></li>
<li>Separated link</li>
<li role="separator" class="divider"></li>
<li>One more separated link</li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left">
<div class="form-group">
<input class="form-control" placeholder="Search" type="text">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li>Link</li>
<li class="dropdown">
Dropdown <span class="caret"></span>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li role="separator" class="divider"></li>
<li>Separated link</li>
</ul>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<div class="container-fluid">
<div class="row table-row">
<div class="col-sm-6 table-col">nav</div>
<div class="col-sm-6 table-col" style="border: 1px solid red;">
<div id="eventsContainer">
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
Basic panel example
</div>
</div>
</div>
</div>
</div>
</div>
CSS:
html,
body {
height: 100%;
/*border: 1px solid red;*/
}
nav.navbar {
margin: 0;
}
.table-row {
height: calc(100vh - 53px);
display: flex;
}
.table-col {
display: flex;
width: 100%;
}
#eventsContainer {
height: 100%;
overflow: auto;
position: absolute;
width: calc(100% - 15px);
}
I checked in firefox, chrome and IE(edge), it works..
I hope this helps you
Related
I have a sidebar on the right that uses 3 elements of a bootstrap grid. I am trying to have the content always to the right of this sidebar (so they must always take up 9). I currently have an accordion and an h2, however I am having a difficult time left-aligning them with the rest of the content on the page. The sidebar is coded as follows:
<div class="col-md-3">
<div class="list-group">
example
</div>
</div>
Each "content div" is as follows (these are aligning properly)
<div class="col-md-9 pull-right">
<div class="panel panel-default">
<div class="panel-heading">
<h4>title</h4>
</div>
<div class="panel-body">
<p>content</p>
</div>
</div>
</div>
This is the h2 and accordion that isn't properly aligning with the content.
<div class="col-md-9 pull-right">
<div class="row">
<div class="col-md-12">
<h2 class="page-header col-md-9 pull-left">Action Strategies: What We Can Do Now</h2>
</div>
</div>
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading together">
<h4 class="panel-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseOne">What We Can Do Together</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse">
<div class="panel-body">
<ul>
<li>list</li>
</ul>
</div>
</div>
</div>
Image to help visualize the problem
without pull-right
Remove the pull-right from the classes list:
<div class="col-md-9 pull-right">
<!-------------------^^^^^^^^^^ This is the culprit to pull it to the right.
The pull-right class just adds float: right !important; to the styles, which make the content to be pushed right.
I am attempting to insert an image into a bootstrap accordion and when I do it makes that section (second accordian section) of the accordion remain open - where it should be collapsed initially allowing for someone to click on it to expand it.
Not sure what it is breaking in the code that is causing this.
Here is a link to code in JSfiddle: https://jsfiddle.net/penrysh/1fLfx04m/3/#&togetherjs=dJTKolqwum
<p><strong>Complete the sections below to upload content.</strong></p>
<div class="container" style="width: 90%;">
<div id="accordionCO0137098" class="panel-group" style="width: 90%;">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Access System</h4>
</div>
<div id="collapseCO0137098_0" class="panel-collapse collapse">
<div class="panel-body"><ol>
<li>Click the <strong>User Name </strong>field</li>
<li>Type your ID</li>
<li>Click the <strong>Password </strong>field</li>
<li>Type your password</li>
<li>Click the <strong>Log In </strong>button</li>
</ol></div>
</div>
</div>
<div class="panel-heading">
<h4 class="panel-title">Add a New Content</h4>
</div>
<div class="panel-body"><ol>
<li>Click the <strong>Content </strong>tab at the top left of the screen<br /><a class="largeimage img-view" href="images/content.png" target="_blank"><img style="width: 248px; height: 71px;" src="images/content.png" alt="" width="225" height="56" border="0" /></a></li>
<li></li>
</ol></div>
<div class="panel-heading">
<h4 class="panel-title">Complete the Required Fields</h4>
</div>
<div id="collapseCO0137098_2" class="panel-collapse collapse">
<div class="panel-body">
<p>Note: You may type a note here.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Upload the Content</h4>
</div>
<div id="collapseCO0137098_3" class="panel-collapse collapse">
<div class="panel-body">
<p>Note: You may type a note here.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Tag the Content</h4>
</div>
<div id="collapseCO0137098_4" class="panel-collapse collapse">
<div class="panel-body">
<p>Note: You may type a note here.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Add Any Relevant Keywords</h4>
</div>
<div id="collapseCO0137098_5" class="panel-collapse collapse">
<div class="panel-body">
<p>Note: You may type a note here.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Add Folders</h4>
</div>
<div id="collapseCO0137098_6" class="panel-collapse collapse">
<div class="panel-body">
<p>Note: You may type a note here.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Add Any Relevant Search</h4>
</div>
<div id="collapseCO0137098_7" class="panel-collapse collapse">
<div class="panel-body">
<p>Note: You may type a note here.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Add Any Relevant Related Content</h4>
</div>
<div id="collapseCO0137098_8" class="panel-collapse collapse">
<div class="panel-body">
<p>Note: You may type a note here.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">Send For Review</h4>
</div>
<div id="collapseCO0137098_9" class="panel-collapse collapse">
<div class="panel-body">
<p>Note: You may type a note here.</p>
</div>
</div>
</div>
</div>
</div>
You messed up the libraries.
Moreover, after the "panel-tile" ... "Add a New Content Object" it's required the
<div id="collapseCO0137098_1" class="panel-collapse collapse">
And, before the
`<div class="panel-heading">`
it's required the
<div class="panel panel-default">
The new jsFiddle is available here.
The snippet:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css">
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<p><strong>Complete the sections below to upload content in the LT&I CMS.</strong></p>
<div class="container" style="width: 90%;">
<div id="accordionCO0137098" class="panel-group" style="width: 90%;">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><a href="#collapseCO0137098_0" data-toggle="collapse"
data-parent="#accordionCO0137098">Access the CMS</a></h4>
</div>
<div id="collapseCO0137098_0" class="panel-collapse collapse">
<div class="panel-body">
<ol>
<li><a href="https://klcm.antheminc.com/aries/index.cfm?" target="_blank">Click this link to
access: https://klcm.antheminc.com/aries/index.cfm?</a></li>
<li>Click the <strong>User Name </strong>field</li>
<li>Type your US Domain ID</li>
<li>Click the <strong>Password </strong>field</li>
<li>Type your US Domain password</li>
<li>Click the <strong>Log In </strong>button</li>
</ol>
</div>
</div>
</div>
<!-- FIX: next line missing -->
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><a href="#collapseCO0137098_1" data-toggle="collapse"
data-parent="#accordionCO0137098">Add a New Content Object</a></h4>
</div>
<!-- FIX: next line missing -->
<div id="collapseCO0137098_1" class="panel-collapse collapse">
<div class="panel-body">
<ol>
<li>Click the <strong>Content </strong>tab at the top left of the screen<br/><a
class="largeimage img-view" href="images/content.png" target="_blank"><img
style="width: 248px; height: 71px;" src="images/content.png" alt="" width="225"
height="56"
border="0"/></a></li>
<li></li>
</ol>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><a href="#collapseCO0137098_2" data-toggle="collapse"
data-parent="#accordionCO0137098">Complete the Required Fields On the
Properties
Panel</a></h4>
</div>
<div id="collapseCO0137098_2" class="panel-collapse collapse">
<div class="panel-body">
<p>Note: You may type a note here.</p>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><a href="#collapseCO0137098_3" data-toggle="collapse"
data-parent="#accordionCO0137098">Upload the Content on the Content Panel</a>
</h4>
</div>
<div id="collapseCO0137098_3" class="panel-collapse collapse">
<div class="panel-body">
<p>Note: You may type a note here.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><a href="#collapseCO0137098_4" data-toggle="collapse"
data-parent="#accordionCO0137098">Tag the Content Items With All Applicable
Categories</a></h4>
</div>
<div id="collapseCO0137098_4" class="panel-collapse collapse">
<div class="panel-body">
<p>Note: You may type a note here.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><a href="#collapseCO0137098_5" data-toggle="collapse"
data-parent="#accordionCO0137098">Add Any Relevant Keywords</a></h4>
</div>
<div id="collapseCO0137098_5" class="panel-collapse collapse">
<div class="panel-body">
<p>Note: You may type a note here.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><a href="#collapseCO0137098_6" data-toggle="collapse"
data-parent="#accordionCO0137098">Add Folders to Content Item</a></h4>
</div>
<div id="collapseCO0137098_6" class="panel-collapse collapse">
<div class="panel-body">
<p>Note: You may type a note here.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><a href="#collapseCO0137098_7" data-toggle="collapse"
data-parent="#accordionCO0137098">Add Any Relevant Search Collections</a></h4>
</div>
<div id="collapseCO0137098_7" class="panel-collapse collapse">
<div class="panel-body">
<p>Note: You may type a note here.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><a href="#collapseCO0137098_8" data-toggle="collapse"
data-parent="#accordionCO0137098">Add Any Relevant Related Content</a></h4>
</div>
<div id="collapseCO0137098_8" class="panel-collapse collapse">
<div class="panel-body">
<p>Note: You may type a note here.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title"><a href="#collapseCO0137098_9" data-toggle="collapse"
data-parent="#accordionCO0137098">Send For Review</a></h4>
</div>
<div id="collapseCO0137098_9" class="panel-collapse collapse">
<div class="panel-body">
<p>Note: You may type a note here.</p>
</div>
</div>
</div>
</div>
The Problem
There is this pesky white space at the bottom of my screen and it won't go away even though I do margin-bottom: 0 or padding-bottom: 0.
If someone could get rid of this white space at the bottom it would be very much appreciated!
My Code
HTML
<div class="container-fluid no-lr-padding no-b-padding">
....
<div id="Menu" class="row-fluid no-b-padding">
<div id="Menu-Header" class="header">
<h1>Problems</h1>
</div>
<div class="panel-group" id="problem-panels">
<div class="panel panel-default top-panel">
<div class="panel-heading" data-toggle="collapse" href="#collapse1">
<h4 class="panel-title">
Cox Subtraction Level 1c
</h4>
</div>
<div id="collapse1" class="panel-collapse collapse in">
<div class="panel-body">
<ul class="nav nav-pills">
<li class="active"><a>11</a></li>
<li><a>12</a></li>
<li><a>13</a></li>
<li><a>14</a></li>
</ul>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title" data-toggle="collapse" href="#collapse2">
Cox Addition Level 3b
</h4>
</div>
<div id="collapse2" class="panel-collapse collapse">
<div class="panel-body">panel body 2</div>
</div>
</div>
<div class="panel panel-default bottom-panel">
<div class="panel-heading">
<h4 class="panel-title" data-toggle="collapse" href="#collapse3">
Cox Subtraction Level 2a
</h4>
</div>
<div id="collapse3" class="panel-collapse collapse">
<div class="panel-body">panel body 3</div>
</div>
</div>
</div>
</div>
</div>
CSS
.no-b-padding{
padding-bottom: 0;
margin-bottom: 0;
}
JSFiddle
You need to remove the bottom margin from your problem-panels div:
#problem-panels {
margin-bottom:0;
}
jsFiddle example
i don't know if the title of my question is related to my problem because i couldn't get better than this sentence ;
i have problem with this code , i have two fixed navbar one in the top and the other in the left and the real problem is like this image and on jsfiddle
the problem is the top nav is above the other nav and i need the top one to be next the left nav like this
the real problem also when i'm using container the other div come above the left side like this photo
how can i fix this problem ? ?
my code is
<body style="background-color:#F2F2F2">
<div style="position: relative; z-index: 3;">
<div class="navbar-fixed-top" style="background-color:#3e474f;height:643px;width:69px;z-index: 2;">
<ul>
<li><a class="fa fa-th-large fa-2x"href="#"></a></li> <li><a class="fa fa-th-large fa-2x"href="#"></a></li> <li><a class="fa fa-th-large fa-2x"href="#"></a></li> <li><a class="fa fa-th-large fa-2x"href="#"></a></li>
</ul>
</div>
<nav style="z-index: 1"class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header navbar-left">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">WebSiteName</a>
</div>
<div class="collapse navbar-collapse navbar-right" id="myNavbar">
<ul class="nav navbar-nav ">
<li><span class="glyphicon glyphicon-user"></span> Sign Up</li>
<li><span class="glyphicon glyphicon-log-in"></span> Login</li>
</ul>
</div>
</div>
</nav>
</div>
ass="container">
<div class="row">
<div class="col-sm-6 ">
<div class="panel-group ">
<div class="panel panel-default">
<div class="panel-heading">Panel with panel-default class</div>
<div class="panel-body">Panel Content</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading">Panel with panel-default class</div>
<div class="panel-body">Panel Content</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading">Panel with panel-default class</div>
<div class="panel-body">Panel Content</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="panel-group">
<div class="panel panel-default">
<div class="panel-heading">Panel with panel-default class</div>
<div class="panel-body">Panel Content</div>
</div>
</div>
</div>
</div>
</div>
<!-------->
</body>
and on jsfiddle
So, try add you your .navbar and .row - margin-left value.
.navbar, .row {
margin-left: 69px;
}
Alesha's answer is correct, but I noticed it leaves the panel contents hidden, to fix it add this code instead.
.row{
padding-top:50px;
padding-left:75px;
}
.navbar-brand{
padding-left: 75px;
}
How can I get these panels to stay inside their wells when the browser window is resized (particularly to the width of a mobile device)? It'd probably be best to resize the well too. I have some overlapping issues as well.
Here's full width:
Here's mobile width (ish):
I'd like that Summary to be in the Volume & Fees well, on its own line, not overlapping with the other wells.
Here's the HTML:
<div class="container">
<div class="row clearfix" id="content-row">
<div class="col-md-12 column">
<div class="well" id="volume-fees-well">
<div class="row clearfix" id="volume-fees-row">
<div class="col-md-9 column" id="volume-fees-chart">
<div class="panel panel-primary" id="volume-fees-panel">
<div class="panel-heading">
<h3 class="panel-title">
Volume & Fees
</h3>
</div>
<div class="panel-body">
<svg></svg>
</div>
</div>
</div>
<div class="col-md-3 column">
<div class="panel panel-primary" id="volume-fees-summary-panel">
<div class="panel-heading">
<h3 class="panel-title">
Summary
</h3>
</div>
<div class="panel-body">
</div>
</div>
</div>
</div>
</div>
<div class="well" id="vehicle-class-well">
I'm using D3 for the charts, which is what the svg is for.
I'm using the Bootswatch Yeti theme and the standard Bootstrap.css. The only CSS I've overridden from the Bootstrap.css is:
#content-row {
margin-top: 50px;
}
#volume-fees-row, #vehicle-class-row, #consignor-map-row, #buyer-map-row {
height: 450px;
}
.panel {
max-width: 100%;
}
.panel-body {
height: 400px;
}
Please let me know if you have any questions!
How can I get these panels to stay inside their wells when the browser window is resized
Just use the .col-xs-* class (instead of col-md-*):
<div class="container">
<div class="row clearfix" id="content-row">
<div class="col-xs-12 column">
<div class="well" id="volume-fees-well">
<div class="row clearfix" id="volume-fees-row">
<div class="col-xs-9 column" id="volume-fees-chart">
<div class="panel panel-primary" id="volume-fees-panel">
<div class="panel-heading">
<h3 class="panel-title">
Volume & Fees
</h3>
</div>
<div class="panel-body">
<svg></svg>
</div>
</div>
</div>
<div class="col-xs-3 column">
<div class="panel panel-primary" id="volume-fees-summary-panel">
<div class="panel-heading">
<h3 class="panel-title">
Summary
</h3>
</div>
<div class="panel-body">
</div>
</div>
</div>
</div>
</div>
<div class="well" id="vehicle-class-well">