Bootstrap sidebar button to change position on collapse

Hi there,

I have the following Bootstrap HTML which collapses a left hand column with a button.

What I would like to do is to have the button in the left hand column like it is now, but when the left column is collapsed, the button is still visible - I guess somehow I need to tell it to have some padding or margin when in collapsed mode?

How would be best to do this?


<div class="row" id="row-main">
			<div class="col-md-3" id="sidebar">
<div class="btn-group" role="group" aria-label="Controls">
					<button type="button" class="hotel-sidebar btn btn-primary toggle-sidebar">COLLAPSE BUTTON</button>
			<div class="col-md-9" id="content">


It all depends how you are hiding the sidebar because the toggle button is in the sidebar and if you are setting display:none on the sidebar there is no way to then display the button.

You should probably put the button outside of the side column to start with and then it won;t disappear with the side column.

It all depends on how you are hiding the sidebar and what your script looks like.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.