Floating Bootstrap Columns - html

I have a footer I am making for a webpage that looks like this
As you can see the right column will not stay in line with the others and the spacing between them is not even. The gradient behind each column is a picture. I tried using pull-right but when I go to resize then it looks weird and doesn't stack on top of each other. Here's my HTML:
<div class="row">
<div class="gradient left">
<div class="text-center button-center">
<a class="btn btn-danger " href="http://nhgreatlakes.com/Portals/Merit/tabid/1298/Default.aspx">
<i class="fa fa-external-link fa-lg"></i> LAUNCH NEW HORIZONS<br>PORTAL</a>
</div>
</div>
<div class="gradient text-center center">
<div class="vertical-center">
<h4 id="connect">Connect With Us!</h4>
<i class="fa fa-facebook fa-2x"></i>
<i class="fa fa-twitter fa-2x"></i>
<i class="fa fa-envelope fa-2x"></i></div>
</div>
<div class="gradient text-center right">
<h3 id="ML">Click to view our upcoming events</h3>
<i class="fa fa-calendar fa-2x" ></i></div>
</div>
and here's the CSS:
.gradient{
width: 278px;
height: 106px;
background-image: url('gradient.png');
}
.button-center{
position: relative;
top: 50%;
transform: translateY(-50%);
}
.vertical-center{
position: relative;
top: 50%;
transform: translateY(-50%);
}
.left{
float: left;
}
.center{
margin-right: auto;
margin-left: auto;
}
.right{
float: right;
}
I need each section to be evenly spaced and to stack correctly when it's resized. And the footer spans the whole container FYI.

within the <div class = 'row'> can add the <div class = "col-sm-4 '> as shown in the Grid System of bootstrap
<div class="row">
<div class="col-sm-4" style='background: #55D946'>a</div>
<div class="col-sm-4" style='background: #5333EC'>b</div>
<div class="col-sm-4" style='background: #D8F02F'>c</div>
</div>

Since your using bootstrap you can use columns in your row, i have added this to your code. Look at how the boostrap grid system works for further understanding.
see Updated Code
.gradient {
width: 278px;
height: 106px;
background-image: url('gradient.png');
}
.button-center {
position: relative;
top: 50%;
transform: translateY(-50%);
}
.vertical-center {
position: relative;
top: 50%;
transform: translateY(-50%);
}
.left {
float: left;
}
.center {
margin-right: auto;
margin-left: auto;
}
.right {
margin-bottom: 20px;
float: right;
}
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="row">
<div class="col-xs-4 gradient left">
<div class="text-center button-center">
<a class="btn btn-danger " href="http://nhgreatlakes.com/Portals/Merit/tabid/1298/Default.aspx">
<i class="fa fa-external-link fa-lg"></i> LAUNCH NEW HORIZONS
<br>PORTAL</a>
</div>
</div>
<div class="col-xs-4 gradient text-center center">
<div class="vertical-center">
<h4 id="connect">Connect With Us!</h4>
<i class="fa fa-facebook fa-2x"></i>
<i class="fa fa-twitter fa-2x"></i>
<i class="fa fa-envelope fa-2x"></i>
</div>
</div>
<div class="col-xs-4 gradient text-center right">
<h3 id="ML">Click to view our upcoming events</h3>
<i class="fa fa-calendar fa-2x" ></i>
</div>
</div>

As you know with bootstrap you get a 12 grids running across.
You need something like:
div class = row for container .
div class= col-md-4 // for all 3 boxes. This assumes no margins or padding on divs otherwise change 4 to a 3

Related

how to align elements with icons under eachother?

I have a few divs that act as lists/buttons on my page.
Each div contains an icon and a text.
I need to keep these 'buttons' in the center of the page but at the same time, I have to align the icons and texts under eachother.
So all the icons are under eachother AND all the texts are under eachother.
This is what I have so far:
code
https://jsfiddle.net/sy21m4dq/
.list{
width:100%;
text-align:center;
}
.list-item{
display:inline-block;
width:250px;
}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="list">
<div class="list-item">
<i class="fa fa-user" aria-hidden="true"></i> Account
</div>
<div class="list-item">
<i class="fa fa-sign-in" aria-hidden="true"></i> Account LOGIN
</div>
<div class="list-item">
<i class="fa fa-star" aria-hidden="true"></i> freedback
</div>
<div class="list-item">
<i class="fa fa-question" aria-hidden="true"></i> Help
</div>
</div>
This is what I am looking to achieve:
could someone please advice on this?
Thanks in advance.
I'd improve your markup structure and leverage a CSS layout option, such as display table, among others.
My suggestion is to have additional layers of markup for the various CSS layout concerns you have / need.
<div class="list">
<div class="list-container">
<div id="list-item">
<div class="list-item-cell"><i class="fa fa-user" aria-hidden="true"></i></div>
<div class="list-item-cell">Account</div>
</div>
<div id="list-item">
<div class="list-item-cell"><i class="fa fa-star" aria-hidden="true"></i></div>
<div class="list-item-cell">freedback</div>
</div>
<div id="list-item">
<div class="list-item-cell"><i class="fa fa-question" aria-hidden="true"></i></div>
<div class="list-item-cell">Help</div>
</div>
<div id="list-item">
<div class="list-item-cell"><i class="fa fa-sign-in" aria-hidden="true"></i></div>
<div class="list-item-cell">Account LOGIN</div>
</div>
</div>
</div>
In this way, you can leverage the type of layout styles you want in a cleaner fashion. Your markup is your skeleton. If you have too few bones, your design will be more limited.
.list{
width:100%;
text-align:center;
}
.list-container {
display: table;
max-width: 400px;
margin: 0 auto;
}
.list-item{
display: table-row;
width:250px;
}
.list-item-cell {
display: table-cell;
}
.list-item-cell:first-child {
padding-right: 10px;
width: 30px;
}
There's a few things going on that I will explain, but the below snippet works.
You had the divs with id="list-item", which was a typo. They needed to be class="list-item".
You had the .list-item as inline-block, but really they should be block, and the container (the .list div) should be set to the 250px width.
A little icing on the cake to make the icons / text really line up was to apply some width to the icons (.list-item .fa).
body{
text-align: center;
}
.list {
display: inline-block;
width: 150px;
}
.list-item {
display: block;
width: auto;
text-align: left;
}
.list-item .fa {
width: 30px;
text-align: center;
}
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class="list">
<div class="list-item">
<i class="fa fa-user" aria-hidden="true"></i> Account
</div>
<div class="list-item">
<i class="fa fa-sign-in" aria-hidden="true"></i> Account LOGIN
</div>
<div class="list-item">
<i class="fa fa-star" aria-hidden="true"></i> freedback
</div>
<div class="list-item">
<i class="fa fa-question" aria-hidden="true"></i> Help
</div>
</div>
Add a fixed width to the icons
i {
width: 20px;
text-align: center;
}
Make the list an inline-flex-container with columns-display
Center the whole box with either text-align-center or flex
https://jsfiddle.net/qw2f3ojt/

How can I get my divs more responsive for phones?

How can I get my "Meet our staff" page more responsive for phones? It's not looking good, having the items all the way to the left with lot of content left to use in the right spot.
I haven't tried much, as I really don't know what I can do.
Codepen here:https://codepen.io/audn/pen/EvNMvO?editors=1100
CSS:
.bg-white{
background-color:white;
height: 216px;
border: 1px solid #ddd;
width: 180px;
display: inline-block;
margin-top:20px;
margin-right:20px;
float:left;
}
.username{
color:black;
font-weight:900;
}
.workspace{
font-size:11px;
color:#999;
}
.contact{
background-color:#1798e5;
display:inline-block;
margin-top:12px;
color:White;
border-radius: .3em;
padding: 6px 10px;
font-size:13px;
text-align:center;
}
.icons{
font-size:16px;
margin-top: 20px;
}
.contact:hover{
background-color:#1765e5;
cursor:pointer;
}
.avatar1{
border-radius:999px;
margin-left:auto;
margin-right:auto;
position:relative;
border: 5px solid white;
width:90px;
height:90px;
}
HTML
<div class="bg-white">
<center>
<img src="http://cdn.edgecast.steamstatic.com/steamcommunity/public/images/avatars/68/68d720a786c605ff0cc4d80f10a4c2d6410bb2fc_full.jpg" class="avatar1">
<div class="username">
audunrp <i class="fa fa-check-circle" aria-hidden="true" style="color:#5EA5E7;"></i>
</div>
<div class="workspace">
Administrator
</div>
<div class="contact" data-target="#audn-contact" data-toggle="modal">
<i class="fa fa-envelope" aria-hidden="true"></i> Message
</div>
</center>
</div>
<!--
audn
--><div class="bg-white">
<center>
<img src="http://cdn.edgecast.steamstatic.com/steamcommunity/public/images/avatars/68/68d720a786c605ff0cc4d80f10a4c2d6410bb2fc_full.jpg" class="avatar1">
<div class="username">
audunrp <i class="fa fa-check-circle" aria-hidden="true" style="color:#5EA5E7;"></i>
</div>
<div class="workspace">
Administrator
</div>
<div class="contact" data-target="#audn-contact" data-toggle="modal">
<i class="fa fa-envelope" aria-hidden="true"></i> Message
</div>
</center>
</div>
<!--
audn
--><div class="bg-white">
<center>
<img src="http://cdn.edgecast.steamstatic.com/steamcommunity/public/images/avatars/68/68d720a786c605ff0cc4d80f10a4c2d6410bb2fc_full.jpg" class="avatar1">
<div class="username">
audunrp <i class="fa fa-check-circle" aria-hidden="true" style="color:#5EA5E7;"></i>
</div>
<div class="workspace">
Administrator
</div>
<div class="contact" data-target="#audn-contact" data-toggle="modal">
<i class="fa fa-envelope" aria-hidden="true"></i> Message
</div>
</center>
</div>
<!--
audn
-->
You can use media-queries for make your html more responsive. Use the width of screen for resize your "bg-white", like "margin-left: 10%; width: 90%", when load site in phones (you set the size of screen in css)
Look more here: https://www.w3schools.com/css/css_rwd_mediaqueries.asp
Using flex.
Codepen: https://codepen.io/pandalism1/pen/EvZKXm
JS Fiddle
#media (max-width: 400px){
.bg-white {
width: 100% !important;
}
}
.container {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.bg-white{
background-color:white;
height: 216px;
border: 1px solid #ddd;
margin: 10px;
width: 200px;
}
.username{
color:black;
font-weight:900;
}
.workspace{
font-size:11px;
color:#999;
}
.contact{
background-color:#1798e5;
display:inline-block;
margin-top:12px;
color:White;
border-radius: .3em;
padding: 6px 10px;
font-size:13px;
text-align:center;
}
.icons{
font-size:16px;
margin-top: 20px;
}
.contact:hover{
background-color:#1765e5;
cursor:pointer;
}
.avatar1{
border-radius:999px;
margin-left:auto;
margin-right:auto;
position:relative;
border: 5px solid white;
width:90px;
height:90px;
}
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="container">
<div class="bg-white">
<center>
<img src="http://cdn.edgecast.steamstatic.com/steamcommunity/public/images/avatars/68/68d720a786c605ff0cc4d80f10a4c2d6410bb2fc_full.jpg" class="avatar1">
<div class="username">
audunrp <i class="fa fa-check-circle" aria-hidden="true" style="color:#5EA5E7;"></i>
</div>
<div class="workspace">
Administrator
</div>
<div class="contact" data-target="#audn-contact" data-toggle="modal">
<i class="fa fa-envelope" aria-hidden="true"></i> Message
</div>
</center>
</div>
<div class="bg-white">
<center>
<img src="http://cdn.edgecast.steamstatic.com/steamcommunity/public/images/avatars/68/68d720a786c605ff0cc4d80f10a4c2d6410bb2fc_full.jpg" class="avatar1">
<div class="username">
audunrp <i class="fa fa-check-circle" aria-hidden="true" style="color:#5EA5E7;"></i>
</div>
<div class="workspace">
Administrator
</div>
<div class="contact" data-target="#audn-contact" data-toggle="modal">
<i class="fa fa-envelope" aria-hidden="true"></i> Message
</div>
</center>
</div>
<div class="bg-white">
<center>
<img src="http://cdn.edgecast.steamstatic.com/steamcommunity/public/images/avatars/68/68d720a786c605ff0cc4d80f10a4c2d6410bb2fc_full.jpg" class="avatar1">
<div class="username">
audunrp <i class="fa fa-check-circle" aria-hidden="true" style="color:#5EA5E7;"></i>
</div>
<div class="workspace">
Administrator
</div>
<div class="contact" data-target="#audn-contact" data-toggle="modal">
<i class="fa fa-envelope" aria-hidden="true"></i> Message
</div>
</center>
</div>
<div class="bg-white">
<center>
<img src="http://cdn.edgecast.steamstatic.com/steamcommunity/public/images/avatars/68/68d720a786c605ff0cc4d80f10a4c2d6410bb2fc_full.jpg" class="avatar1">
<div class="username">
audunrp <i class="fa fa-check-circle" aria-hidden="true" style="color:#5EA5E7;"></i>
</div>
<div class="workspace">
Administrator
</div>
<div class="contact" data-target="#audn-contact" data-toggle="modal">
<i class="fa fa-envelope" aria-hidden="true"></i> Message
</div>
</center>
</div>
<div class="bg-white">
<center>
<img src="http://cdn.edgecast.steamstatic.com/steamcommunity/public/images/avatars/68/68d720a786c605ff0cc4d80f10a4c2d6410bb2fc_full.jpg" class="avatar1">
<div class="username">
audunrp <i class="fa fa-check-circle" aria-hidden="true" style="color:#5EA5E7;"></i>
</div>
<div class="workspace">
Administrator
</div>
<div class="contact" data-target="#audn-contact" data-toggle="modal">
<i class="fa fa-envelope" aria-hidden="true"></i> Message
</div>
</center>
</div>
<div class="bg-white">
<center>
<img src="http://cdn.edgecast.steamstatic.com/steamcommunity/public/images/avatars/68/68d720a786c605ff0cc4d80f10a4c2d6410bb2fc_full.jpg" class="avatar1">
<div class="username">
audunrp <i class="fa fa-check-circle" aria-hidden="true" style="color:#5EA5E7;"></i>
</div>
<div class="workspace">
Administrator
</div>
<div class="contact" data-target="#audn-contact" data-toggle="modal">
<i class="fa fa-envelope" aria-hidden="true"></i> Message
</div>
</center>
</div>
</div>
</body>
You could add a wrapper element, say a section, around the 3 divs with a class of bg-white. Add a style of text-align: center to center the 3 .bg-white divs within their section container.
Then, add a media query that will allow you to style the .bg-white divs at a certain screen/device width. Let's choose an arbitrary width of 640px.
At this break point, you can change the width of the .bg-white divs from their original width of 180px to 100% and make them display: block instead of display: inline-block so that they take up the entire width of the page and each will sit on it's own line.
These are the CSS changes you'd need to make this work.
.bg-white {
background-color:white;
height: 216px;
border: 1px solid #ddd;
width: 180px;
display: inline-block;
margin-top:20px;
margin-right:20px;
/* float: left; */
}
section {
text-align: center;
}
/* place at the bottom of your CSS file, after all other rules */
#media (max-width: 640px)
{
.bg-white {
width: 100%;
display: block;
}
}
Don't forget to wrap your 3 .bg-white divs in a section container so that you can center them within this parent container.
These changes will give you 3 .bg-white divs that are centered within their parent container when your users view your site on their computers/laptops, and will show the same markup but with different, mobile optimized styles on mobile devices (because of the media query styles getting picked up when device width <= 640px).
Screenshots of what these added CSS rules and the addition of the section container would do for you.
Desktop
Mobile

not able to get div with border

I am trying to achieve a simple css border effect with proper padding. Trying to make it responsive without using bootstrap.
I just have one font and border around it and arrows between two div but I am not getting it
code:
#import url('https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');
.work {
float: left;
border: 4px solid black;
padding: 10px 10px 10px 10px;
}
.work:before {
content: '\f178';
margin-top: 10px;
position: absolute;
right: -11px;
top: 44%;
}
<div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST1</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST2</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST3</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST4</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST5</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST6</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST7</h4>
</div>
</div>
link to codepen: https://codepen.io/rahulv/pen/BRwjEd
what I am trying to acheive is I dont get padding between two boxes also I want arrow between them .. its like test1 -> test2 -> test3..
You are missing the border style property which is required. Also you need position: relative; on .work to make the absolutely positioned psuedo element work, and the font-awesome font-family. Text-align: center for icons...
Check out full example:
.work{
position: relative;
float:left;
border: 4px solid black;
padding: 10px 10px 10px 10px;
text-align: center;
}
.work:not(:last-of-type) {
margin-right: 20px;
}
.work:not(:last-of-type):before {
content: '\f178';
font-family: "FontAwesome";
margin-top: 10px;
position: absolute;
right: -22px;
top: 41%;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST1</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST2</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST3</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST4</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST5</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST6</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST7</h4>
</div>
</div>
You need to do following changes
.work:before {
content: '\f178';
margin-top: 0;
position: absolute;
right: -23px;
top: 50%;
transform: translateY(-50%);
font-family: 'FontAwesome';
}
and
.work:not(:last-of-type) {
margin-right: 20px;
}
Here is working final demo
http://codepen.io/sajiddesigner/pen/EmwKvj
To put the font awesome arrow outside of the right of the parent, use right: 0; to move it to the right side, then push it outside of the parent with translateX().
To have the puzzle piece right above the text, remove the margin (or just margin-top) from the text.
To have space between the boxes, you need a right margin.
.work {
float: left;
border: 4px solid black;
padding: 10px;
margin-right: 25px;
position: relative;
}
h4 {
margin: 0;
}
.work:before {
content: '\f178';
position: absolute;
transform: translateX(150%);
top: 50%; right: 0;
font-family: 'FontAwesome';
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST1</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST2</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST3</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST4</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST5</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST6</h4>
</div>
<div class="work">
<i class="fa fa-puzzle-piece"></i>
<h4>TEST7</h4>
</div>
</div>
You need to specify the type of border
try using this:
border: 4px black solid;

how do I make multiple divs width change dynamically with out overlapping when window size changes

I have a div with three divs inside of different width. when my window size changes it is overlapping each other.How do I make content remain without overlapping when window size changes.
Here is my code.
#topBarContainer{
background-color: blue;
}
#topBarLeft{
width: 14%;
text-align: center;
}
#topBarMiddle{
width: 26%;
text-align: center;
}
#topBarRight{
width: 60%;
text-align: right;
}
.topBar {
margin-right: -4px;
text-align: center;
display: inline-block;
padding-top: 5px;
padding-bottom: 3px;
}
<div id="topBarContainer">
<!--TopBar-->
<div id="topBarLeft" class="topBar">
<input type="button" ng-click="newMenuType('message')" value="New" id="newButton">
</div>
<!--Top Bar Middle-->
<div id="topBarMiddle" class="topBar">
<div class="searchBoxContainer">
<i class="fa fa-search fa-flip-horizontal" id="searchBoxIcon"> </i>
<input type="text" placeholder="Search Inbox" class="searchBox" ng-model="searchEmail" />
</div>
</div>
<!--Top Bar Right-->
<div id="topBarRight" class="topBar">
<div>
<div class="loginRow">Hi{{loginName()}}</div>
<div ng-if="emailIcon()" class="iconRow">
<i class="fa fa-reply"></i>
</div>
<div ng-if="emailIcon()" class="iconRow">
<i class="fa fa-reply-all"></i>
</div>
<div ng-if="emailIcon()" class="iconRow" >
<i class="fa fa-reply fa-flip-horizontal"></i>
</div>
<div ng-if="!isDeletedView() && emailIcon()" class="iconRow">
<i class="fa fa-trash"></i>
</div>
</div>
</div>
</div>
It is looking good with normal window when I resize window it is overlapping all.leftBar takes 14%and middle bar takes 26% and rest for the right container.
I am spenting days to fix this. I need to align all so that all 3 sections display in the same line.
you can use display:flex from flexbox
body {
margin: 0
}
#topBarContainer {
background-color: blue;
display: flex;
}
#topBarLeft {
width: 14%;
text-align: center;
}
#topBarMiddle {
text-align: center;
background: red;
width: 35%
}
#topBarRight {
text-align: right;
background: green;
flex: 1
}
#topBarRight > div {
display: inline-flex
}
.topBar {
text-align: center;
padding-top: 5px;
padding-bottom: 3px;
}
#topBarRight >div:last-of-type {
text-align: center
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" />
<div id="topBarContainer">
<!--TopBar-->
<div id="topBarLeft" class="topBar">
<input type="button" ng-click="newMenuType('message')" value="New" id="newButton">
</div>
<!--Top Bar Middle-->
<div id="topBarMiddle" class="topBar">
<div class="searchBoxContainer">
<i class="fa fa-search fa-flip-horizontal" id="searchBoxIcon"> </i>
<input type="text" placeholder="Search Inbox" class="searchBox" ng-model="searchEmail" />
</div>
</div>
<!--Top Bar Right-->
<div id="topBarRight" class="topBar">
<div>
<div class="loginRow">Hi{{loginName()}}</div>
<div ng-if="emailIcon()" class="iconRow">
<i class="fa fa-reply"></i>
</div>
<div ng-if="emailIcon()" class="iconRow">
<i class="fa fa-reply-all"></i>
</div>
<div ng-if="emailIcon()" class="iconRow">
<i class="fa fa-reply fa-flip-horizontal"></i>
</div>
<div ng-if="!isDeletedView() && emailIcon()" class="iconRow">
<i class="fa fa-trash"></i>
</div>
<div ng-show="canMoveToFolder()" class="iconRow" ng-mouseover="newIcon = true" ng-mouseleave="newIcon = false"> <i class="fa fa-folder-o"> </i>
<div ng-if="newIcon" id="newItemOptions">
<label class='newItemLabel' ng-click="moveMessageToFolder(3)">Inbox</label>
<label class='newItemLabel' ng-click="moveMessageToFolder(4)">Sent</label>
</div>
</div>
</div>
</div>
</div>
I'm not sure if it is what you are looking for but if you put your searchBoxContainer in display:flex; it shud solwe the problem cause it puts your searchBoxIcon in front of the searchBox it self
you have to pu in your css
.searchBoxContainer{
display:flex;
}
#topBarContainer{
background-color: blue;
}
#topBarLeft{
width: 14%;
text-align: center;
}
#topBarMiddle{
width: 26%;
text-align: center;
}
#topBarRight{
width: 60%;
text-align: right;
}
.topBar {
margin-right: -4px;
text-align: center;
display: inline-block;
padding-top: 5px;
padding-bottom: 3px;
}
.searchBoxContainer{
display:flex;
}
<div id="topBarContainer">
<!--TopBar-->
<div id="topBarLeft" class="topBar">
<input type="button" ng-click="newMenuType('message')" value="New" id="newButton">
</div>
<!--Top Bar Middle-->
<div id="topBarMiddle" class="topBar">
<div class="searchBoxContainer">
<i class="fa fa-search fa-flip-horizontal" id="searchBoxIcon"> </i>
<input type="text" placeholder="Search Inbox" class="searchBox" ng-model="searchEmail" />
</div>
</div>
<!--Top Bar Right-->
<div id="topBarRight" class="topBar">
<div>
<div class="loginRow">Hi{{loginName()}}</div>
<div ng-if="emailIcon()" class="iconRow">
<i class="fa fa-reply"></i>
</div>
<div ng-if="emailIcon()" class="iconRow">
<i class="fa fa-reply-all"></i>
</div>
<div ng-if="emailIcon()" class="iconRow" >
<i class="fa fa-reply fa-flip-horizontal"></i>
</div>
<div ng-if="!isDeletedView() && emailIcon()" class="iconRow">
<i class="fa fa-trash"></i>
</div>
</div>
</div>
</div>
Why are all elements moved right with that negative margin on the .topBar class? I would just erase that, and add box-sizing: border-box; to .topBar (just to be on the safe side for percentage widths and heights).
So you'd have
.topBar {
box-sizing: border-box;
text-align: center;
display: inline-block;
padding-top: 5px;
padding-bottom: 3px;
}

Is there a simple way to ensure .well items have the same height and width regardless of screen size?

I have three .well items on my homepage, and I don't want to fill them with content just to ensure they size correctly on every screen. Ideally I'd like a CSS solution that can specify their height and width match each other regardless of which screen they are being displayed on (and also that they stack correctly when the window shrinks.
/* CSS used here will be applied after bootstrap.css */
#benefit-box-1 {
padding-top: 1em;
display: inline-block;
text-align: center;
float: left;
}
#benefit-box {
padding-top: 1em;
display: inline-block;
text-align: center;
float: left;
}
#benefit-box-3 {
padding-top: 1em;
display: inline-block;
text-align: center;
float: left;
}
#benefit-row-2 {
margin-top: 1px;
}
.icon-div {
display:inline-block;
text-align: centre;
vertical-align: bottom;
width: 100%;
height: 100%;
}
.icon-div:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
margin-right: -0.25em; /* Adjusts for spacing */
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div class="container-fluid">
<div class="row" id="benefit-row">
<div class="col-md-4" id="benefit-box-1">
<div class="well">
<div class="icon-div">
<i class="fa fa-users fa-4x"></i>
<h1>Collaborate in your sales meetings.</h1>
</div>
</div>
</div>
<div class="col-md-4" id="benefit-box">
<div class="well">
<div class="icon-div">
<i class="fa fa-map-signs fa-4x"></i>
<h1>Direct your team to the best deals</h1>
</div>
</div>
</div>
<div class="col-md-4" id="benefit-box-3">
<div class="well">
<div class="icon-div">
<i class="fa fa-filter fa-4x"></i>
<h1>Trust your pipeline forecast</h1>
</div>
</div>
</div>
</div>
<div class="row" id="benefit-row-2">
<div class="col-md-4" id="benefit-box-1">
<div class="well">
<div class="icon-div">
<i class="fa fa-bullseye fa-4x"></i>
<h1>Helps you target the right contacts</h1>
</div>
</div>
</div>
<div class="col-md-4" id="benefit-box">
<div class="well">
<div class="icon-div">
<i class="fa fa-graduation-cap fa-4x"></i>
<h1>In-built sales training</h1>
</div>
</div>
</div>
<div class="col-md-4" id="benefit-box-3">
<div class="well">
<div class="icon-div">
<i class="fa fa-line-chart fa-4x"></i>
<h1>Smash your sales targets</h1>
</div>
</div>
</div>
</div>
</div>
I made a bootply here: My attempts
I managed to solve this issue by dropping the wells/bootstrap standard responsive behaviour and adopting some of my own using the Flex methods. If anyone is interested here's the bootply: Flex CSS classes to make responsive pages
I used the info present here in order to make this work - standard behaviour on my boxes is to have 33% of the screen width on large devices, 50% on medium devices and 100% on small devices. Works a charm.
From what I can tell it's not going to be very useful on older browsers (I don't particularly care for my project) but on modern browsers it works just as planned.