I have a simple side nav that I built out that I want fixed. From my understanding of bootstrap classes columns are supposed to be aligned. My second column for most of my page content ends up falling behind my sidenav. How do you have a second column aligned with your first while keeping that first column fixed?
#logo {
height: 40vh;
width: 20vw; }
.dropdown-toggle, .dropdown-menu {
width: 300px; }
.btn-group img {
margin-right: 10px; }
.dropdown-toggle {
padding-right: 50px; }
.dropdown-toggle .glyphicon {
margin-left: 20px;
margin-right: -40px; }
.dropdown-menu > li > a:hover {
background: white; }
/* $search-blue */
.dropdown-header {
background: #ccc;
font-size: 14px;
font-weight: 700;
padding-top: 5px;
padding-bottom: 5px;
margin-top: 10px;
margin-bottom: 5px; }
#sidebar {
min-width: 250px;
max-width: 250px;
height: 100vh;
border: 1px solid pink; }
/*# sourceMappingURL=notification.css.map */
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container-fluid" style="background-color: #e0f7fa">
<div class="d-flex flex-row" style="border:1px solid black;">
<div class="col d-flex justify-content-start" style="border:1px solid blue;">
<img id="logo" src="./images/logo.png">
</div><!--logo -->
<div class="col d-flex align-items-center justify-content-end" style="border:1px solid red;">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img src="http://lorempixel.com/75/50/abstract/" style="border-radius: 50%;">
0123 4567 8912 3456
<span class="glyphicon glyphicon-chevron-down"></span>
</button>
<ul class="dropdown-menu">
<li class="dropdown-header">Member name (you)</li>
<li>
<img src="http://lorempixel.com/75/50/abstract/">0123 4567 8912 3456
</li>
<li>
<img src="http://lorempixel.com/75/50/abstract/">0123 4567 8912 3456
</li>
<li class="dropdown-header">Member name</li>
<li>
<img src="http://lorempixel.com/75/50/abstract/">0123 4567 8912 3456
</li>
</ul>
</div>
</div><!--dropdown for profile image,name and description -->
</div>
</div><!--container for header -->
<div class="container-fluid" style="border: 1px solid black">
<div class="row">
<div class="col-4 position-fixed align-self-start">
<nav id="sidebar">
<!-- Sidebar Header -->
<div class="sidebar-header">
<h3>Notification</h3>
</div>
<!-- Sidebar Links -->
<ul class="list-unstyled components">
<li class="active">Edit Profile</li>
<li>Privacy & Security</li>
<li>Payment Setting</li>
<li>Transaction History</li>
<li>Trust & Verfication</li>
<li>My Education Blog</li>
<li>Promotions</li>
</ul>
<ul>Cancel Account</ul>
</nav>
</div>
<div class="col-8 align-self-center">
<h3>Send notifications via</h3>
</div><!--this should be directly next to navbar -->
</div>
</div><!--container for navbar and page content -->
You can see that I have a header in the top page with an image and a dropdown in its own container. Then following that I have a container with the sidenav and where it says "get notifications via" is misplaced. I added borders so you can see the where everything is located.
Related
My problem is that a div class with bootstrap "navbar" is overlapping my md-12 div however the content is still displayed but not clickable. I have no clue what makes this happens.
DEMO: https://elevarbetensys.se/SY15/MS15/GYARB/index.php
Question: How do i "remove" or change so it can be clickable. My logo and languageselector aren't clickable now.
<div class="container text-center">
<div class="row">
<div id="home">
</div>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4" style="float: left;">
<h6>This restaurant is educational purpose<br>All orders will be considered as donations.</h6>
</div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4" style="float: left;">
<a href="#home">
<img class="navbar" src="images/Burning_Rooster.png" alt="Burning_Rooster">
</a>
<p>RESTAURANT & LOUNGE BAR</p>
</div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4" style="float: left;">
<ul class="languagepicker roundborders large navbar-right">
<li><img src="images/flags/us.png"/>English</li>
<li><img src="images/flags/nl.png"/>Nederlands</li>
<li><img src="images/flags/de.png"/>German</li>
<li><img src="images/flags/fr.png"/>Français</li>
<li><img src="images/flags/es.png"/>Español</li>
<li><img src="images/flags/it.png"/>Italiano</li>
<li><img src="images/flags/se.png"/>Svenska</li>
</ul>
</div>
</div>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<i class="fa fa-bars" aria-hidden="true" style="font-size:24px;"></i>
</button>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li>
HOME
</li>
<li>
MENU
</li>
<li>
GALLERY
<li>
RESERVATION
</li>
<li>
REVIEWS
</li>
<li>
CONTACT
</li>
</ul>
</div>
</div>
</nav>
<img src="images/restaurant/welcome.jpg" alt="Welcome" class="img-responsive img-rounded">
<h2>Burning Rooster Since 1969</h2>
<p>14 February 1969, was the year evertying came to place. Our service have been running since.
<br>
At our restaurant we serve you the finest food and desserts. Burning Rooster became popular immediatly with our rooster delicacy.
<br>
People across the whole world came to taste our finest rooster meny. Our meny have gave pleasure to world famous humans like
<br>
Freddy Mercury, Mel Gibson, Kiss and Donald duck creator.
</p>
<hr>
</div>
</div>
CSS:
#home {
height: auto;
margin-right: auto;
margin-left: auto;
width: auto;
text-align: center;
}
.languagepicker {
background-color: #FFF;
display: inline-block;
padding: 0;
height: 40px;
overflow: hidden;
transition: all .3s ease;
margin: 0 0 10px 0;
vertical-align: top;
float: left;
}
.languagepicker:hover {
/* don't forget the 1px border */
height: 81px;
}
.languagepicker a{
color: #000;
text-decoration: none;
font-size: 16px;
}
.languagepicker li {
display: block;
padding: 0px 20px;
line-height: 40px;
border-top: 1px solid #EEE;
}
.languagepicker li:hover{
background-color: #EEE;
}
.languagepicker a:first-child li {
border: none;
background: #FFF !important;
}
.languagepicker li img {
margin-right: 5px;
}
.roundborders {
border-radius: 5px;
}
.large:hover {
/*
don't forget the 1px border!
The first language is 40px heigh,
the others are 41px
*/
height: 286px;
}
Firstly, you're closing your #home as soon as you create it: <div id="home"></div>.
Secondly, I think all you need to do is override the position property of the navbar, which is relative. Assuming nav is child of #home, try the following:
#home > nav {
position: inherit;
}
I couldn't find anything like this on internet so I'm asking you guys! The problem is that my icons overlap my collapsed navbar.
My code:
<div class="container-fluid">
<div class="row">
<div class="">
<div id="black">
<nav class="navbar navbar-default navbar-inverse" role="navigation">
<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">
<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="img-responsive col-xs-4 col-sm-8 col-md-10 col-lg-12" href="#">
<img id="logo2" alt="Logo" class="" height="80%" width="73%" src="images/logo1.png">
</a>
</div>
<div class="container-fluid">
<div class="row">
<div class="">
<div id="black">
<nav class="navbar navbar-default navbar-inverse" role="navigation">
<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">
<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="img-responsive col-xs-4 col-sm-8 col-md-10 col-lg-12" href="#">
<img id="logo2" alt="Logo" class="" height="80%" width="73%" src="images/logo1.png">
</a>
</div>
<!-- Navbar contentas -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a class="visible-lg" href="#">Pagrindinis</a></li>
<li><a class="visible-lg" href="#">Kontaktai</a></li>
<li><a class="visible-lg" href="#">Apie mus</a></li>
<li><a class="visible-lg" href="#">Paslaugos</a></li>
<li></li>
<li class="dropdown">
Dropdown <span class="caret"></span>
<ul class="dropdown-menu" role="menu">
<li></li>
<li>Pagrindinis</li>
<li>Apie mus</li>
<li>Kontaktai</li>
<li>+370 67651008</li>
<li class="divider"></li>
<li>One more separated link</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><p class="navbar-text" style="margin-left: 15px;" >Already have an account?</p></li>
<li class="dropdown">
<b>Login</b> <span class="caret"></span>
<ul id="login-dp" class="dropdown-menu">
<li>
<div class="row">
<div class="col-md-12">
Login via
<div class="social-buttons">
<i class="fa fa-facebook"></i> Facebook
<i class="fa fa-twitter"></i> Twitter
</div>
or
<form class="form" role="form" method="post" action="login" accept-charset="UTF-8" id="login-nav">
<div class="form-group">
<label class="sr-only" for="exampleInputEmail2">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail2" placeholder="Email address" required>
</div>
<div class="form-group">
<label class="sr-only" for="exampleInputPassword2">Password</label>
<input type="password" class="form-control" id="exampleInputPassword2" placeholder="Password" required>
<div class="help-block text-right">Forget the password ?</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary btn-block">Sign in</button>
</div>
<div class="checkbox">
<label>
<input type="checkbox"> keep me logged-in
</label>
</div>
</form>
</div>
<div class="bottom text-center">
New here ? <b>Join Us</b>
</div>
</div>
</li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
</div>
<div id="mint"></div>
<div class="" id="background1">
<div class="container-fluid">
<img class="img-responsive" id="logo1" src="images/logo1.png"/>
</div>
<div class="container-fluid">
<p id="p1" class="" >A great new free psd theme to showcase your<br>new application.</p>
</div>
<div id="sicons">
<img class="img-responsive col-xs-3 col-sm-3 col-md-4 col-lg-4" src="images/icon1.png"/>
<img class="img-responsive col-xs-3 col-sm-3 col-md-4 col-lg-4" style="margin-left: -15px; margin-right: -15px;" src="images/icon2.png"/>
<img class="img-responsive col-xs-3 col-sm-3 col-md-4 col-lg-4" src="images/icon3.png"/>
</div>
</div>
CSS:
body {
margin: 0px;
padding: 0px;
font-family: sans-serif;
}
#black {
height: 48px;
background-color: #282828;
}
/*------------NAVBAR DALYKAI-------------------------*/
#login-dp{
min-width: 250px;
padding: 14px 14px 0;
overflow:hidden;
background-color:rgba(255,255,255,.8);
}
#login-dp .help-block{
font-size:12px
}
#login-dp .bottom{
background-color:rgba(255,255,255,.8);
border-top:1px solid #ddd;
clear:both;
padding:14px;
}
#login-dp .social-buttons{
margin:12px 0
}
#login-dp .social-buttons a{
width: 49%;
}
#login-dp .form-group {
margin-bottom: 10px;
}
.btn-fb{
color: #fff;
background-color:#3b5998;
}
.btn-fb:hover{
color: #fff;
background-color:#496ebc
}
.btn-tw{
color: #fff;
background-color:#55acee;
}
.btn-tw:hover{
color: #fff;
background-color:#59b5fa;
}
#media(max-width:768px){
#login-dp{
background-color: inherit;
color: #fff;
}
#login-dp .bottom{
background-color: inherit;
border-top:0 none;
}
}
/*-------------------------------------------------------------------------------------------------------------------------*/
#mint {
height: 10px;
background-color: #2ecc71;
}
#background1
{
height: 600px;
background-image: url("images/background1.jpg");
background-repeat: no-repeat;
background-size:100%;
}
.p {
font-family: Myriad Pro;
}
#logo1 {
width: 10%;
margin-left: 20%;
margin-top: 11%;
}
#logo2 {
margin-top: 5%;
}
#p1 {
font-family: helvica-thin;
margin-left: 20%;
margin-top: 2%;
color: white;
font-size: 1.5vw;
}
#sicons {
position: absolute;
margin-left: 20%;
background-color: grey;
}
#sicons a:hover {
color: green;
}
#white {
height: 245px;
}
#icons {
position: absolute;
}
#iframe {
/*margin-top: 55px;
margin-left: 350px;*/
border-radius: 10px;
overflow: hidden;
max-width: 560px;
max-height: 315px;
}
#button {
border-radius: 0px 10px 10px 0px;
height: 56px;
width: 141px;
background-color: #2ecc71;
border: 0;
box-shadow:none;
color: white;
font-size: 24px;
}
#p2 {
position: absolute;
text-align: center;
}
#grey {
height: 427px;
background-color: #e3e3e3;
}
#white1 {
height: 468px;
}
#grey1 {
min-height: 130px;
background-color: #e3e3e3;
}
From looking at your code sample, it appears the culprit is #sicons having a value of position: absolute;. Items positioned absolutely will always sit on top of relatively position items. Try assigning your navbar and #sicons containers with z-index values, making #sicons's value lower than your navbar.
For more information about how z-index works, how it interacts with positioned elements, and the stacking order, check out the answer on this Stack Overflow question: "Understanding z-index stacking order"
I have read a lot of posts about this but I still didn't find an answer.
I have a footer that I want to be at the end of the page, not fixed.
The problem is that the footer is where the content ends. Look at picture.
This is my HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title> Mobtech - Privatni korisnici </title>
<!--Ubaci bootstrap css -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<link rel="css/basic-template.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed" rel="stylesheet">
</head>
<body>
<!--Navigation bar -->
<nav class="navbar navbar-default" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-container">
<span class="sr-only"> Pokazi i sakrij navigaciju </span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">
<span> <img src="Slike/logo.png" alt="LogoSlika"/> </span>
<font face="Roboto Condensed" size="4" color="green"> Mobtech </font>
</a>
</div>
<div class="collapse navbar-collapse" id="navbar-container">
<ul class="nav navbar-nav navbar-right">
<li> Početna strana </li>
<li class="active"> Privatni korisnici </li>
<li> Poslovni korisnici </li>
<li> Uređaji </li>
<li> O Nama </li>
</ul>
</div>
</div>
</nav>
<br />
<div class="container"> <!--Container -->
<div class="row">
<!-- Kolona na velikom ekranu (lg) prikazuje duzinu jedne kolone, Ekstra small (xs) prikazuje 4 kolone -->
<div class="col-lg-12 bg-success">
<p> Outer div </p>
<div class="col-lg-6 bg-primary">
<p> Inner div </p>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer class="mojFooter">
<font face="Roboto Condensed" size="4"> <center>
<div class="container">
<div class="row" style="margin-top: 7px;">
<p> © Copyright Ivan Prošić 2016.</p>
</div>
<div class="bottom-footer">
<div class="col-md-12">
<ul class="footer-nav">
<li> Facebook </li>
<li> Twitter </li>
<li> Google+ </li>
</ul>
</div>
</div>
</div>
</font> </center>
</footer>
<!-- JavaScript fajl -->
<script src="js/jquery.min.js"></script>
<!-- Kompresovan JavaScript fajl -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
This is my CSS, for the footer only:
.mojFooter{
background-color: #f8f8f8;
color: #00a651;
padding-top: 0px;
border-top: 1px solid #e7e7e7;
margin-bottom: 0px;
}
.bottom-footer{
border-top: 1px solid #00a651;
margin-top: 0px;
padding-top: 7px;
color: #00a651;
}
.footer-nav li{
display: inline;
padding: 0px 40px;
}
.footer-nav a{
color: grey;
text-decoration: none;
}
When using bootstrap 4 or 5, flexbox could be used to achieve desired effect:
<body class="d-flex flex-column min-vh-100">
<header>HEADER</header>
<content>CONTENT</content>
<footer class="mt-auto"></footer>
</body>
Please check the examples: Bootstrap 4 Bootstrap 5
In bootstrap 3 and without use of bootstrap. The simplest and cross browser solution for this problem is to set a minimal height for body object. And then set absolute position for the footer with bottom: 0 rule.
body {
min-height: 100vh;
position: relative;
margin: 0;
padding-bottom: 100px; //height of the footer
box-sizing: border-box;
}
footer {
position: absolute;
bottom: 0;
height: 100px;
}
Please check this example:
Bootstrap 3
In my case for Bootstrap4:
<body class="d-flex flex-column min-vh-100">
<div class="wrapper flex-grow-1"></div>
<footer></footer>
</body>
You can just add:
style="min-height:100vh"
to your page content container and place the footer in another container
Use this stylesheet:
/* Sticky footer styles
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
line-height: 60px; /* Vertically center the text there */
background-color: #f5f5f5;
}
/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */
body > .container {
padding: 60px 15px 0;
}
.footer > .container {
padding-right: 15px;
padding-left: 15px;
}
code {
font-size: 80%;
}
© 2021 Company, Inc
<a href="/" class="col-md-4 d-flex align-items-center justify-content-center mb-3 mb-md-0 me-md-auto link-dark text-decoration-none">
<svg class="bi me-2" width="40" height="32"><use xlink:href="#bootstrap"/></svg>
</a>
<ul class="nav col-md-4 justify-content-end">
<li class="nav-item">Home</li>
<li class="nav-item">Features</li>
<li class="nav-item">Pricing</li>
<li class="nav-item">FAQs</li>
<li class="nav-item">About</li>
</ul>
:root {
--text: #daf7a6;
--header: #581845;
--main: #900c3f;
--footer: #ff5733;
}
*,
*:before,
*:after {
box-sizing: border-box;
}
html,
body {
height: 100%;
}
header,
main,
footer {
color: var(--text);
height: 100px;
padding: 1rem;
}
header {
background-color: var(--header);
}
main {
background-color: var(--main);
}
footer {
background-color: var(--footer);
position: sticky;
top: 100vh;
}
<header>header</header>
<main>content</main>
<footer>footer</footer>
I having problems trying to centralize a bootstrap standard nav in a row.
<footer id="page_footer">
<div class="container">
<div class="row">
<div class="col-md-8">
<ul id="page_footer_links" class="nav nav-pills nav-center">
<li role="presentation">Home</li>
<li role="presentation">Profile</li>
<li role="presentation">Messages</li>
</ul>
</div>
<div class="col-md-4">
<p id="page_footer_wordpress" class="text-center">Orgulhosamente movido com WordPress!!!</p>
</div>
</div>
</div>
Here the complete fiddle: http://jsfiddle.net/vpontin/bkpnrLo0/
I tried putting text-center and center-block. None worked. Even putting margin 0 auto or text-align: center didn't work.
What i need to do?
The .nav-pills list items have default floating behavior to left. So change it to none and display them in one line using display: inline-block.
Updated JSfiddle
#page_footer {
background-color: #f5f5f5;
width: 100%;
}
#page_footer .container {
padding: 20px;
}
#page_footer_links {
margin: 0 auto;
text-align: center;
}
#page_footer_wordpress {
margin: 0px;
height: 40px;
line-height: 40px;
}
.nav-pills > li {
float: none !important;
display: inline-block !important;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<footer id="page_footer">
<div class="container">
<div class="row">
<div class="col-md-8">
<ul id="page_footer_links" class="nav nav-pills nav-center">
<li role="presentation">Home
</li>
<li role="presentation">Profile
</li>
<li role="presentation">Messages
</li>
</ul>
</div>
<div class="col-md-4">
<p id="page_footer_wordpress" class="text-center">Orgulhosamente movido com WordPress!!!</p>
</div>
</div>
</div>
Firstly this question has been before (in a fashion) but without examples: Hiding an element completly that has had some overflow hidden
The Problem
I'm using the Gridster framework http://gridster.net/ to display some content and it uses a fixed height on each content area with overflow:hidden.
The content that I place in each content area could be 10 characters long or 100 characters (in a responsive framework) bootstrap and so can sometime get cut off.
Supporting Images
How it looks now
How I would like it to look
Example code
HTML
<div class="example_container">
<div class="WidgetContent pull-left">
<ul class="unstyled">
<li class="person ActivePerson">
<div class="StaffThumb pull-left">
<img src="https://cdn1.iconfinder.com/data/icons/dot/256/man_person_mens_room.png">
</div>
<div class="expert-details pull-left">
<ul class="innerBox unstyled">
<li>
James Harris
</li>
<li>Senior Management</li>
<li>London</li>
<li>VP, Marketing Communications</li>
</ul>
</div>
<div class="container-number pull-right">
<span class="label">76</span>
</div>
</li>
<li class="person ">
<div class="StaffThumb pull-left">
<img src="https://cdn1.iconfinder.com/data/icons/dot/256/man_person_mens_room.png">
</div>
<div class="expert-details pull-left">
<ul class="innerBox unstyled">
<li>
Carlos Fernandez
</li>
<li>Senior Management</li>
<li>Madrid</li>
<li>Senior Business Development Coordinator</li>
</ul>
</div>
<div class="container-number pull-right">
<span class="label">72</span>
</div>
</li>
<li class="person ">
<div class="StaffThumb pull-left">
<img src="https://cdn1.iconfinder.com/data/icons/dot/256/man_person_mens_room.png">
</div>
<div class="expert-details pull-left">
<ul class="innerBox unstyled">
<li>
Kate Evans
</li>
<li>Research</li>
<li>London</li>
<li>Communications Systems Analyst - Millar A/C Manager</li>
</ul>
</div>
<div class="container-number pull-right">
<span class="label">71</span>
</div>
</li>
<li class="person ">
<div class="StaffThumb pull-left">
<img src="https://cdn1.iconfinder.com/data/icons/dot/256/man_person_mens_room.png">
</div>
<div class="expert-details pull-left">
<ul class="innerBox unstyled">
<li>
Brian Montrose
</li>
<li>Business Development</li>
<li>New York</li>
<li>Business Development Analyst</li>
</ul>
</div>
<div class="container-number pull-right">
<span class="label">70</span>
</div>
</li>
<li class="person ">
<div class="StaffThumb pull-left">
<img src="https://cdn1.iconfinder.com/data/icons/dot/256/man_person_mens_room.png">
</div>
<div class="expert-details pull-left">
<ul class="innerBox unstyled">
<li>
Alison Roberts
</li>
<li>HR</li>
<li>San Francisco</li>
<li>HR - Pension</li>
</ul>
</div>
<div class="container-number pull-right">
<span class="label">68</span>
</div>
</li>
</ul>
</div></div>
CSS
.example_container { width:300px; height:325px; overflow:hidden; }
.WidgetContent {
width: 100%;
position: relative;
}
.pull-left {
float: left;
}
.pull-right {
float: left;
}
ul.unstyled, ol.unstyled {
list-style: none outside none;
margin-left: 0;
padding:0;
}
.ActivePerson {
background-color: #FCF8E3;
}
.person {
border-bottom: 1px dashed #E2E2E2;
display: block;
padding: 7px 50px;
}
li {
overflow: hidden;
}
.StaffThumb img {
border-radius: 3px;
height: 35px;
margin: 4px 10px 0 0;
width: 35px;
}
.StaffThumb {
left: 10px;
margin: 0;
position: absolute;
}
.container-number {
position: absolute;
right: 10px;
}
.ActivePerson .label {
background-color: #F89406;
}
.label {
font-size: 16px;
line-height: 20px;
margin: 0 5px;
position: relative;
top: 5px;
border-radius: 3px;
padding: 1px 4px 2px;
}
Example Fiddle
http://jsfiddle.net/3sTNL/
This little extra CSS: Uses flex layout
.WidgetContent {
height: 100%;
}
.WidgetContent > .unstyled {
margin: 0;
display: flex;
flex-direction: column;
flex-wrap: wrap;
float:left;
height: 100%;
}
.person {
position: relative;
}
fiddle here
YES!
Add column-width to the ul, equal to the container's width.
Add height to the ul, equal to the container's height minus padding/margin
Add break-inside:avoid (-webkit-column-break-inside) to the .people items
Result: http://jsfiddle.net/3sTNL/3/ (Tested in Chrome)
This is VERY haxy XD But it works!