Can't move my div using float-right inside container - html

I have a container where i store 2 div's. ".logo" and ".navbar-list" how can I move my ".navbar-list" to the right edge of container.
Previously everything worked but when I switched bootstrap to version 4.3.1 my div's overlapped .I've tried float:right but is not working.
container {
font-family: sans-serif;
height: 100%;
margin-left: auto;
margin-right: auto;
float: none;
padding: 0;
}
.logo {
width: 380px;
margin-right: 0;
position: absolute;
height: 100%;
margin-left: 10px;
}
.navbar-list {
color: white;
width: 300px;
height: 100%;
}
<div class="container">
<div class="logo">
<a class="navbar-brand" href="#"><img src="img/640px-HSV-Logo.png" /></a>
<h1>WITAJ W <span>DOMU!</span></h1>
</div>
<div class="navbar-list ">
<ul>
<li>
<span class=" glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Sklep
</li>
</ul>
<ul>
<li> <button type="button" class="btn btn-danger btn-md ">
<span class="glyphicon glyphicon-user" aria-hidden="true"></span> Zaloguj się
</button></li>
</ul>
</div>
</div>

There are lots of methods of achieving your desired result! In my opinion, Flexbox would be your best option. You should add display: flex to your .container. You can add the flex to the .logo container as well, if you want the logo and h1 to sit side by side.
You should also avoid using float, as this often makes HTML behave unexpectedly. You can replace this with justify-content: space-between.
I've amended your example above to incorporate my amends:
.container {
font-family: sans-serif;
padding: 0;
height: 80px;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
width: 380px;
/*margin-right: 0; */
/*position: absolute; */
height: 100%;
margin-left: 10px;
display: flex;
align-items: center;
}
.navbar-list {
color: white;
width: 300px;
height: 100%;
}
<div class="container">
<div class="logo">
<a class="navbar-brand" href="#"><img src="img/640px-HSV-Logo.png" /></a>
<h1>WITAJ W <span>DOMU!</span></h1>
</div>
<div class="navbar-list ">
<ul>
<li>
<span class=" glyphicon glyphicon-shopping-cart" aria-hidden="true"></span> Sklep
</li>
</ul>
<ul>
<li> <button type="button" class="btn btn-danger btn-md ">
<span class="glyphicon glyphicon-user" aria-hidden="true"></span> Zaloguj się
</button></li>
</ul>
</div>
</div>

From a high level, the go-to method for this situation is using flexbox instead of floats. Not sure about Bootstrap in your case or why you had that change happen.
.container {
display: flex;
justify-content: flex-end; /* and many more positioning options */
}

just add float: right; to your .navbar-list css then you can move your div to right side
.navbar-list {
color: white;
width: 300px;
height: 100%;
float: right;
}

Related

3 links in sidebar moved to the right with dispaly flex and I don't know why

I am trying to create a sidebar for a website with 10 sidebar links. most of the links work with the css but 3 of these links moved to the right. all with a different margin. It is so strange. the problem comes with aside .sidebar a {..} when I used display flex in it 3 of the items in the sidebar moved. can anyone help?
* {
margin: 0;
padding: 0;
outline: 0;
appearance: none;
border: 0;
box-sizing: border-box;
}
body {
width: 100vw;
height: 100vh;
overflow-x: hidden;
}
.container {
display: grid;
width: 96%;
margin: 0 auto;
gap: 1.8rem;
grid-template-columns: 14rem auto 23rem;
}
aside {
height: 100vh;
}
aside .top {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 1.4rem;
}
aside .logo {
display: flex;
gap: 0.8rem;
}
aside .logo img {
width: 2rem;
height: 2rem;
}
aside .close {
display: none;
}
/* sidebar */
aside .sidebar {
display: flex;
flex-direction: column;
height: 86vh;
position: relative;
top: 3rem;
}
aside .sidebar a {
display: flex;
margin-left: 2rem;
gap: 1rem;
align-items: center;
position: relative;
height: 3.7rem;
}
aside .sidebar a:last-child {
position: absolute;
bottom: 2rem;
width: 100%;
}
<div class="container">
<aside>
<div class="top">
<div class="logo">
<img src="logo.png" alt="">
<h2>NA <span class ="danger">AM</span></h2>
</div>
<div class="close" id="close-btn">
<span class="matial-icons-sharp">close</span>
</div>
</div>
<div class="sidebar">
<a href="#" class ="active">
<span class="material-icons-sharp">grid_view</span>
<h3>Dashboard</h3>
</a>
<a href="#" >
<span class="material-icons-sharp">person outline</span>
<h3>Klanten</h3>
</a>
<a href="#">
<span class="material-icons-sharp">receipt long</span>
<h3>Bestellingen</h3>
</a>
<a href="#">
<span class="material-icons-sharp">insights</span>
<h3>Analytics</h3>
</a>
<a href="#">
<span class="material-icons-sharp">mail outline</span>
<h3>Berichten</h3>
<span class="message-count">99</span>
</a>
<a href="#">
<span class="material-icons-sharp">inventory</span>
<h3>Producten</h3>
</a>
<a href="#">
<span class="material-icons-sharp">report_gmailerrorred</span>
<h3>Klachten</h3>
</a>
<a href="#">
<span class="material-icons-sharp">settings</span>
<h3>Instellingen</h3>
</a>
<a href="#">
<span class="material-icons-sharp">add</span>
<h3>Product toevoegen</h3>
</a>
<a href="#">
<span class="material-icons-sharp">logout</span>
<h3>Uitloggen</h3>
</a>
</div>
</aside>
</div>
Your declaration for grid-template-columns did not leave enough room for the sidebar. Therefore there were overflow issues because of the grid specificity and especially cause there are no widths defined on any of the sidebar elements.
The grid before:
The grid after:
I also set your display: flex; directly on your a using aside>.sidebar>a. You did not include the child combinator > so it was setting those styles on all of those classes, not just the a. Lastly, you should have widths defined for your flex-items, or else the browser will assume their width based on content and you will end up with un-aligned content. I also cleaned up other aspects of the HTML and CSS. Please see the snippet below for those changes.
* {
margin: 0;
padding: 0;
outline: 0;
appearance: none;
border: 0;
box-sizing: border-box;
}
body {
width: 100vw;
height: 100vh;
overflow-x: hidden;
}
.container {
display: grid;
width: 96%;
margin: 0 auto;
gap: 1.8rem;
grid-template-columns: 23rem auto 23rem;
}
aside {
height: 100vh;
width: 100%;
}
aside .top {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 1.4rem;
}
aside .logo {
display: flex;
gap: 0.8rem;
}
aside .logo img {
width: 2rem;
height: 2rem;
}
aside .close {
display: none;
}
/* sidebar */
aside .sidebar {
display: flex;
flex-direction: column;
height: 100vh;
position: relative;
top: 3rem;
}
aside>.sidebar>a {
display: flex;
margin-left: 2rem;
gap: 1rem;
align-items: center;
position: relative;
height: 3.7rem;
}
span,
h3 {
width: 100%;
min-width: 120px;
white-space: nowrap;
}
<div class="container">
<aside>
<div class="top">
<div class="logo">
<img src="logo.png" alt="">
<h2>NA <span class="danger">AM</span></h2>
</div>
<div class="close" id="close-btn">
<span class="matial-icons-sharp">close</span>
</div>
</div>
<div class="sidebar">
<a href="#" class="active">
<span class="material-icons-sharp">grid_view</span>
<h3>Dashboard</h3>
</a>
<a href="#">
<span class="material-icons-sharp">person outline</span>
<h3>Klanten</h3>
</a>
<a href="#">
<span class="material-icons-sharp">receipt long</span>
<h3>Bestellingen</h3>
</a>
<a href="#">
<span class="material-icons-sharp">insights</span>
<h3>Analytics</h3>
</a>
<a href="#">
<span class="material-icons-sharp">mail outline</span>
<h3>Berichten<span class="message-count"> 99</span></h3>
</a>
<a href="#">
<span class="material-icons-sharp">inventory</span>
<h3>Producten</h3>
</a>
<a href="#">
<span class="material-icons-sharp">report_gmailerrorred</span>
<h3>Klachten</h3>
</a>
<a href="#">
<span class="material-icons-sharp">settings</span>
<h3>Instellingen</h3>
</a>
<a href="#">
<span class="material-icons-sharp">add</span>
<h3>Product toevoegen</h3>
</a>
<a href="#">
<span class="material-icons-sharp">logout</span>
<h3>Uitloggen</h3>
</a>
</div>
</aside>
</div>

How to center a drop-down menu

I am trying to make a NavBar but whenever I have a dropdown I need to add I need to decide whether to put it right or left. Can anyone help me with a way to make it center.
I have tried to use the float element but it doesn't really do anything
HTML:
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Products
</a>
<div class="dropdown-menu dropdown-menu-doors-windows">
<div class="row">
<div class="col-md-6">
<img class="pic-align" src="img/products/doors/doors_3.png" />
</div>
<div class="col-md-6">
<img class="win-align" src="img/products/windows/windows_2.png" />
</div>
</div>
</div>
</li>
CSS:
.win-align {
text-align: center;
height: 250px;
width: 190px;
margin-bottom: 20px;
}
.dropdown-menu-doors-windows {
width: 900px;
height: 400px;
border-top-right-radius: 15px;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
border-top-left-radius: 15px;
opacity: 0.97;
}
.pic-align {
text-align: center;
height: 250px;
width: 140px;
margin-bottom: 20px;
}
I don't see code. your parent element class {display: flex; justify-content: center}
floats don't work flex, bootstrap is built on flex

How to make image of footer responsive to mobile devices?

In my project I have footer with image as background.
I set it inside css. You can see it below. It looks nice only in big screen devices but ugly in mobile screen. How to make image responsive?
I don't have much experience in frontend and I would like to know what are the options?
I use bootstrap 4 by the way.
Here the link to jsfiddle.
/*
* START: Footer
*/
footer {
background: url('http://enjoyjumping.kz/static/img//footer.png') no-repeat;
background-size: 100% 100%;
width: 100%;
height: 500px;
bottom: 0;
position: absolute;
}
footer .row {
align-items: flex-end;
}
.flex-container {
display: flex;
flex-direction: column;
}
.flex-container > div {
width: 100px;
margin: 10px;
text-align: center;
line-height: 75px;
font-size: 30px;
}
.social {
display: flex;
justify-content: center;
flex-wrap: wrap;
}
.social__button {
display: block;
width: 70px;
height: 70px;
border-radius: 100%;
border-color: #fff;
position: relative;
cursor: pointer;
margin: 5px;
text-align: center;
}
.social__button i {
display: inline-block;
position: absolute;
left: 0;
top: 0;
height: 70px;
line-height: 70px;
width: 70px;
font-size: 30px;
z-index: 2;
transition: 0.3s;
color: black;
border: 2px solid;
border-radius: 100%;
}
.social__button i:hover {
color: white;
}
.copyright {
margin-bottom: 2.1rem !important;
font-size: 18px;
font-weight: bold;
}
.menu-link {
color: black !important;
font-weight: bold;
}
.menu-link-li {
margin: 10px;
}
.footer-menu {
margin-bottom: 0.7rem !important;
}
/*
* END: Footer
*/
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<footer>
<div class="container-fluid h-100">
<div class="row h-100">
<div class="col-sm text-center footer-menu">
<ul class="list-unstyled">
<li class="menu-link-li">
<a class="menu-link no-underline text-uppercase" href="/about/">About Us</a>
</li>
<li class="menu-link-li">
<a class="menu-link no-underline text-uppercase" data-toggle="modal" data-target="#citiesModel" style="cursor: pointer;">Our clubs</a>
</li>
<li class="menu-link-li">
<a class="menu-link no-underline text-uppercase" href="/coaches/">News</a>
</li>
<li class="menu-link-li">
<a class="menu-link no-underline text-uppercase" href="/bonus/">Events</a>
</li>
</ul>
</div>
<div class="col-sm text-center">
<div class="flex-container">
<div class="w-100">
<div class="social">
<a href="#" class="social__button facebook">
<i class="fa fa-facebook"></i>
</a>
<a href="#" class="social__button instagram">
<i class="fa fa-instagram"></i>
</a>
<a href="#" class="social__button vk">
<i class="fa fa-vk"></i>
</a>
<a href="#" class="social__button youtube">
<i class="fa fa-youtube-play"></i>
</a>
</div>
</div>
<div class="w-100">
<span>+7(701)</span><strong>262-47-50</strong>
</div>
</div>
</div>
<div class="col-sm text-center">
<p class="copyright">Copyright © 2018 example.com</p>
</div>
</div>
</div>
</footer>
You need to change the background-size and background-position attributes of <footer>:
footer {
background: url('http://enjoyjumping.kz/static/img/footer.png') no-repeat top center /cover;
}
See it working: https://jsfiddle.net/7mejchb8/11/
Edit, based on comments: See this example on how to keep footer glued to the bottom of the page on all devices, while allowing it to have a variable height, without using position:absolute: https://jsfiddle.net/websiter/d4n1sxop/
CSS behind it is:
body {
min-height: 100vh;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
}
header {
flex-grow: 0;
}
main {
flex-grow: 1;
}
footer {
flex-grow: 0;
display: flex;
flex-direction: column;
justify-content: flex-end;
min-height: 500px;
}

Bootstrap responsive table and buttons

I am trying to make my table and buttons to be responsive but without success.
The buttons aren't fixed to the width when I decrease the size of the screen and the table below is set behind of this buttons and not below as it should be.
The search bar and buttons are supposed to be fixed below the navbar.
The system is like an admin system, where I display the logs from my other system (getting the data from MongoDB).
I am attaching screenshots and source code.
HTML-
<header>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<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="brand" href="#">
<img src="./image/logoC.png">
</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li><i class="fa fa-sign-in fa-fw"></i>Logins
</li>
<li><i class="fa fa-user-plus fa-fw"></i>Signup
</li>
<li><i class="fa fa-exclamation-circle fa-fw"></i>Add Items Errors
</li>
<li><i class="fa fa-retweet fa-fw"></i>Refresh Log
</li>
<li>Refresh Errors
</li>
<li>Bad Product
</li>
<li><i class="fa fa-refresh fa-fw"></i>Refresh All
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><i class="fa fa-sign-out fa-fw"></i>Logout</li>
</ul>
</div>
</div>
</div>
</header>
<div class="table_content">
<div class="row">
<div class="options">
<div class="col-sm-4">
<form class="searchBox">
<div class="form-group">
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-search"></i>
</div>
<input type="text" class="form-control" ng-model="searchLogins">
</div>
</div>
</form>
</div>
<div class="col-sm-8">
<ul class="pager" ng-show="currentPage==login">
<li>
<button id="markAsHandled" name="markAsHandled" class="btn btn-success" ng-click="handle()" value="Handle">Mark as Handled</button>
</li>
<li>
<button id="deleteError" name="deleteError" class="btn btn-danger" ng-click="remove()" value="Remove">Delete Errors</button>
</li>
<li>
<button id="select_all" name="deleteError" class="btn btn-info" ng-model="selectedAll" ng-click="checkAll()">Select All</button>
</li>
<li>
<button ng-click="removeLogs()" id="deleteAllErrors" name="deleteError" class="btn btn-danger">Remove All</button>
</li>
</ul>
<h5 id="statusMessage">{{statusMsg}}</h5>
</div>
</div>
</div>
</div>
<div class="tableAdmin">
<table ng-table="tableParams" class="table table-striped" show-filter="true">
<tr ng-repeat="log in $data| orderBy:sortType:sortReverse | filter : searchLogins">
<td data-title="'ID'">
{{log._id}}
</td>
<td data-title="'Data'">
{{log.logData}}
</td>
<td data-title="'Date'">
{{log.logDate}}
</td>
<td data-title="'Handled'">
<input type="checkbox" ng-model="log.selected" />
</td>
</tr>
</table>
</div>
<footer class="footer">
<div class="container">
<div class="row">
<div class="span9">
<p class="text-muted">Copyright © 2017 - Designed & Developed by me.</p>
</div>
</div>
</div>
</footer>
</div>
CSS-
html {
width: 100%;
height: 100%;
}
body {
font-family: 'Lato', Calibri, Arial, sans-serif;
background: #f9f9f9;
font-weight: 300;
font-size: 15px;
overflow: scroll;
overflow-x: hidden;
width: 100%;
height: 100%;
}
.btn {
font-weight: 400;
width: 100px;
height: 36px;
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
cursor: pointer;
}
#markAsHandled {
width: 130px;
margin-right: 5px;
float: left;
}
#deleteError {
width: 110px;
margin-right: 5px;
float: left;
}
#select_all {
width: 110px;
margin-right: 15px;
float: left;
}
#deleteAllErrors {
width: 110px;
float: left;
}
#statusMessage {
float: left;
margin-left: 10px;
padding-top: 10px;
}
.table {
width: 80%;
height: 100%;
margin-top: 55px;
margin-left: 6px;
}
#ID_column {
width: 230px;
}
#user_column {
width: 230px;
}
#date_column {
width: 230px;
}
#handled_column {
width: 100px;
}
input[type="radio"],
input[type="checkbox"] {
line-height: normal;
margin-left: 50px;
}
.btn-success {
margin-left: 26px;
width: 100px;
}
#import url(http://fonts.googleapis.com/css?family=Lato:300,400,700);
*,
*:after,
*:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
margin: 0;
}
.ckbox {
position: relative;
}
.ckbox input[type="checkbox"] {
opacity: 0;
}
.table_content {
width: 100%;
margin-top: 66px;
}
td {
word-wrap: break-word;
overflow-wrap: break-word;
}
.searchBox {
float: left;
width: 400px;
margin: 10px 0 0 0;
}
/*Menu Options*/
.options {
float: left;
width: 100%;
height: 50px;
position: fixed;
display: block;
padding-left: 10px;
background-color: #f9f9f9;
z-index: 1000;
}
.pager {
float: left;
margin: 10px 0 0 10px;
}
.tableAdmin {
width: 100%;
padding-top: 20px;
padding-left: 50px;
}
.badgebox {
opacity: 0;
}
.badgebox + .badge {
text-indent: -999999px;
width: 27px;
}
.badgebox:focus + .badge {
box-shadow: inset 0px 0px 5px;
}
.badgebox:checked + .badge {
text-indent: 0;
}
#div1 {
height: 50px;
width: 100%;
margin-left: 35%;
}
footer {
padding: 50px 0;
height: auto;
text-align: center;
}
Thank you guys.
I've fixed this issue by decreasing the size of the search area and the size of the buttons.

Child DIV fallen outside of parent DIV

So, my parent DIV contains 3 main DIV which contain a couple DIVs each. I have the parents li elements displayed inline as I want all 3 nested DIVs to be side by side along the width of the parent. I have been successful with getting the first two lined up correctly. The third div has the correct x-axis positioning however on the y-axis it has dropped down and outside of the parent div and I'm not sure where I am going wrong. I have tried many many different solutions on StackOverflow, however, none have had any success.
I have the right-hand div (the one below parent) set to absolute as if it's not then it does not get the correct x-axis, with absolute it gets half the position correct.
Relevant code:
.supContainer {
position: absolute;
top: 900px;
left: 38%;
width: 400px;
}
.supContainer ul {
list-style-type: none;
padding-left: 0px;
margin: 0;
}
.supContainer li {
display: inline-block;
white-space: nowrap;
margin-top: 10px;
margin-right: 10px;
}
#supp {
margin-left: 295px;
}
.leftUpper {
width: 233px;
padding-left: 47px;
}
.leftLower {
width: 233px;
padding-bottom: 10px;
}
.supMid {
float: none;
margin-right: 5px;
width: 201px;
padding-left: 238px;
}
.rightUpper {
width: 266px;
}
.rightLower {
width: 266px;
}
.wrapper .leftSide {
margin-top: 24px;
position: absolute;
width: 233px;
left: 0;
}
.wrapper .rightSide {
float: right;
position: absolute;
width: 273px;
left: 445px;
/*top:88px;*/
}
.wrapper {
width: 730px;
height: 155px;
overflow: hidden;
}
#sysit {
margin-left: 35px;
}
#comms {
margin-left: 15px;
}
#collapseExample {
width: 730px;
}
/* GLOBAL CLASSES FOR COMMON ADJUSTMENTS */
.inLine li {
/* Remember to define a width within parent */
display: inline-block;
white-space: nowrap;
}
.borderMe {
border: 2px solid black;
}
.borderMeGreen {
border: 2px solid green;
}
.borderMeRed {
border: 2px solid red;
}
.paddSingleLine {
padding-top: 15px;
padding-bottom: 15px;
}
<div class="supContainer">
<button class="btn btn-warning" id="supp" type="button" data-toggle="collapse" data-target="#collapseExample">Support</button>
<div class="collapse borderMe" id="collapseExample">
<li>
<ul>
<br/>
<div class="wrapper inLine borderMe">
<div class="leftSide">
<div class="leftUpper inLine">
<li>
<button class="btn btn-warning" type="button">Capital
<br/>Equipment</button>
</li>
<li>
<button class="btn btn-warning" type="button">Finance
<br/>Process</button>
</li>
</div>
<div class="leftLower inLine">
<li>
<button class="btn btn-warning paddSingleLine" type="button">NDA</button>
</li>
<li>
<button class="btn btn-warning" type="button">QMS
<br/>Update</button>
</li>
<li>
<button class="btn btn-warning paddSingleLine" type="button">Projects</button>
</li>
</div>
</div>
<div class="supMid">
<li>
<button class="btn btn-warning" id="sysit" type="button">Systems and IT</button>
</li>
<br/>
<li>
<button class="btn btn-warning" id="comms" type="button">Communication
<br/>Relationship/Structure</button>
</li>
<br/>
<li>
<button class="btn btn-warning" type="button">Disaster Recovery Planning</button>
</li>
</div>
<div class="rightSide borderMe">
<div class="rightUpper inLine">
<li>
<button class="btn btn-warning paddSingleLine" type="button">Admin</button>
</li>
<li>
<button class="btn btn-warning" type="button">Recruitment
<br/>/Contractors</button>
</li>
</div>
<div class="rightLower inLine">
<li>
<button class="btn btn-warning" type="button">Export
<br/>Control</button>
</li>
<li>
<button class="btn btn-warning paddSingleLine" type="button">HR Staff</button>
</li>
<li>
<button class="btn btn-warning paddSingleLine" type="button">HS and E</button>
</li>
</div>
</div>
</div>
</ul>
</li>
</div>
</div>
And a screen-grab of the output of the code:
Sorry for the sloppy code I'm new to this. If you could tell me where I've gone wrong but also why it's gone wrong and why the solution will fix it I'd be grateful as it will aid my learning.
Cheers and thanks in advance.
You are messing it up with position:absolute. Check the solution below.
Just update:
.supMid {
float: left;
margin-right: 5px;
width: 201px;
}
.wrapper .leftSide {
position: relative;
width: 233px;
float: left;
}
.wrapper .rightSide {
float: left;
position: relative;
width: 273px;
}
.wrapper {
width: 730px;
height: 155px;
overflow: hidden;
padding-top: 10px;
}
.supContainer {
position: absolute;
top: 900px;
left: 38%;
width: 400px;
}
.supContainer ul {
list-style-type: none;
padding-left: 0px;
margin: 0;
}
.supContainer li {
display: inline-block;
white-space: nowrap;
margin-top: 10px;
margin-right: 10px;
}
#supp {
margin-left: 295px;
}
.leftUpper {
width: 233px;
padding-left: 47px;
}
.leftLower {
width: 233px;
padding-bottom: 10px;
}
.supMid {
float: left;
margin-right: 5px;
width: 201px;
}
.rightUpper {
width: 266px;
}
.rightLower {
width: 266px;
}
.wrapper .leftSide {
position: relative;
width: 233px;
float: left;
}
.wrapper .rightSide {
float: left;
position: relative;
width: 273px;
}
.wrapper {
width: 730px;
height: 155px;
overflow: hidden;
padding-top: 10px;
}
#sysit {
margin-left: 35px;
}
#comms {
margin-left: 15px;
}
#collapseExample {
width: 730px;
}
/* GLOBAL CLASSES FOR COMMON ADJUSTMENTS */
.inLine li {
/* Remember to define a width within parent */
display: inline-block;
white-space: nowrap;
}
.borderMe {
border: 2px solid black;
}
.borderMeGreen {
border: 2px solid green;
}
.borderMeRed {
border: 2px solid red;
}
.paddSingleLine {
padding-top: 15px;
padding-bottom: 15px;
}
<div class="supContainer">
<button class="btn btn-warning" id="supp" type="button" data-toggle="collapse" data-target="#collapseExample">Support</button>
<div class="collapse borderMe" id="collapseExample">
<li>
<ul>
<br/>
<div class="wrapper inLine borderMe">
<div class="leftSide">
<div class="leftUpper inLine">
<li>
<button class="btn btn-warning" type="button">Capital
<br/>Equipment</button>
</li>
<li>
<button class="btn btn-warning" type="button">Finance
<br/>Process</button>
</li>
</div>
<div class="leftLower inLine">
<li>
<button class="btn btn-warning paddSingleLine" type="button">NDA</button>
</li>
<li>
<button class="btn btn-warning" type="button">QMS
<br/>Update</button>
</li>
<li>
<button class="btn btn-warning paddSingleLine" type="button">Projects</button>
</li>
</div>
</div>
<div class="supMid">
<li>
<button class="btn btn-warning" id="sysit" type="button">Systems and IT</button>
</li>
<br/>
<li>
<button class="btn btn-warning" id="comms" type="button">Communication
<br/>Relationship/Structure</button>
</li>
<br/>
<li>
<button class="btn btn-warning" type="button">Disaster Recovery Planning</button>
</li>
</div>
<div class="rightSide borderMe">
<div class="rightUpper inLine">
<li>
<button class="btn btn-warning paddSingleLine" type="button">Admin</button>
</li>
<li>
<button class="btn btn-warning" type="button">Recruitment
<br/>/Contractors</button>
</li>
</div>
<div class="rightLower inLine">
<li>
<button class="btn btn-warning" type="button">Export
<br/>Control</button>
</li>
<li>
<button class="btn btn-warning paddSingleLine" type="button">HR Staff</button>
</li>
<li>
<button class="btn btn-warning paddSingleLine" type="button">HS and E</button>
</li>
</div>
</div>
</div>
</ul>
</li>
</div>
</div>
Try this
Jsfiddle
Give .supMid property display: inline-block
.supMid{
float:none;
display: inline-block;
margin-right:5px;
width:201px;
padding-left:238px;
}
Just give vertical-align:top to .rightSide. No need of position to set element
.wrapper .rightSide {
float: right;
width: 250px;
vertical-align: top;
}
Try to change some of their properties. I used float instead of position
.wrapper .leftSide {
margin-top: 24px;
float: left;
width: 233px;
}
.supMid {
float: left;
margin-right: 5px;
width: 201px;
}
.wrapper .rightSide {
float: left;
width: 273px;
}