Increase height of flex container with min-height on flex item - css

I'm trying to create a layout - with a left floating div with vertical video/speaker/information divs and a right floating div with chapters - where the containers for chapters and information both cover the rest of the remaining height, with vertical scroll.
An example layout can be found at http://codepen.io/westis/pen/NPLwmy, with the HTML and CSS below. The embedded video is just an example video.
html, body {
font-family: arial, helvetica;
height: 100%;
margin: 0;
}
.title {
font-size: 1.5em;
padding: 0.5em;
margin-top: 0;
margin-bottom: 1em;
border-bottom: 3px solid #000;
text-transform: uppercase;
}
.main-container {
height: 100%;
display: flex;
display: -webkit-flex;
flex-direction: row;
-webkit-flex-direction: row;
}
.left {
width: 59%;
margin-right: 2%;
float: left;
flex-direction: column;
display: flex;
position:relative;
flex-grow: 1;
}
.right {
float: right;
width: 39%;
background: #ff8100;
flex-direction: column;
display: flex;
position:relative;
flex-grow: 1;
}
.video {
position: relative;
padding-bottom: 57.25%;
padding-top: 25px;
height: 0;
z-index: 99;
flex: 1 1 auto;
}
.video iframe, .video video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.speaker-container {
display: block;
width: 100%;
flex: 1 0 auto;
background: #ccc;
}
.speaker {
display: block;
float: left;
padding: 0.5em;
line-height: 1.5em;
}
.main-container h2 {
font-size: 1.5em;
line-height: 1.5;
font-style: normal;
font-weight: 400;
margin: 0;
}
.info-container {
overflow-y: auto;
flex: 1 0.5 auto;
margin-top: 1em;
}
.info {
background: #739bd2;
padding: 0.5em;
}
.chapter-container {
min-height: 200px;
overflow-y: auto;
}
.chapter-list {
padding: 0;
border-bottom: 1px solid #444;
margin: 0;
list-style: none;
}
.chapter {
display: block;
}
.chapter a {
padding: 0.5em 1em;
border-top: 1px solid #000;
text-decoration: none;
color: #000;
display: block;
}
h2 {
flex: 0 0 auto;
}
footer {
clear: both;
background: #000;
color: #fff;
padding: 1em;
}
<h1 class="title">Agenda title</h1>
<div class="main-container">
<div class="left">
<div class="video"><iframe width="560" height="315" src="https://www.youtube.com/embed/lbtxvWsNERY?rel=0&showinfo=0" frameborder="0" allowfullscreen></iframe></div>
<div class="speaker-container">
<div class="speaker">Some name
</div>
</div>
<div class="info-container">
<div class="info scrollbox">
<h2 class="info-title">Chapter 1</h2>
<div class="info-text"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas at lobortis sapien. Vivamus lacinia egestas diam et faucibus. Curabitur ac mi fermentum, sodales arcu a, consectetur ipsum. Cras blandit lorem quis erat viverra, at iaculis enim consectetur. Vestibulum vel fermentum erat. Nam at justo ac elit pellentesque semper. Vivamus fringilla mattis nisl ut convallis. Nullam urna sem, pharetra sit amet hendrerit convallis, facilisis sed tortor. Integer suscipit hendrerit sollicitudin. Phasellus tristique orci enim, sit amet varius nulla faucibus quis.</p>
<p>Fusce massa quam, eleifend a ligula ut, porttitor suscipit turpis. Fusce id metus vitae nisi efficitur consequat in vitae arcu. Phasellus euismod hendrerit euismod. Vivamus maximus, nibh in dignissim viverra, massa eros lobortis lorem, at mollis elit purus at felis. Sed iaculis sed lacus a tristique. Mauris porta sodales massa, vel ultricies eros tristique a. Phasellus dolor justo, porta egestas elementum nec, interdum ut orci. Donec id orci nisl. Quisque sed erat nisi. Etiam ultrices nulla sit amet augue ultrices, ut ornare urna mattis.</p>
<p>Sed tortor ante, bibendum nec justo vel, efficitur tincidunt ex. Vestibulum condimentum neque et tincidunt dignissim. Maecenas eu erat ligula. Morbi quis dui a tortor hendrerit euismod. Aenean nibh odio, maximus sed nibh vitae, sagittis egestas sem. Fusce sapien nulla, malesuada molestie eros et, tristique lobortis libero. Quisque eget purus tortor. Sed eros odio, ultrices id ornare non, varius eu tellus. Morbi ante lectus, aliquam fermentum ligula sed, hendrerit luctus turpis. Duis sem neque, tincidunt ut gravida nec, lobortis at eros. Proin ullamcorper dui eu feugiat egestas. Nulla facilisi. Suspendisse a mollis arcu.</p></div>
</div>
</div>
</div>
<div class="right">
<h2>Chapters</h2>
<div class="chapter-container">
<ul class="chapter-list">
<li class="chapter">chapter 1</li>
<li class="chapter">chapter 2</li>
<li class="chapter">chapter 3</li>
<li class="chapter">chapter 4</li>
<li class="chapter">chapter 5</li>
<li class="chapter">chapter 6</li>
<li class="chapter">chapter 7</li>
<li class="chapter">chapter 8</li>
<li class="chapter">chapter 9</li>
<li class="chapter">chapter 10</li>
<li class="chapter">chapter 11</li>
<li class="chapter">chapter 12</li>
<li class="chapter">chapter 13</li>
<li class="chapter">chapter 14</li>
<li class="chapter">chapter 15</li>
<li class="chapter">chapter 16</li>
<li class="chapter">chapter 17</li>
<li class="chapter">chapter 18</li>
<li class="chapter">chapter 19</li>
<li class="chapter">chapter 20</li>
</ul>
</div>
</div>
</div>
<footer>Some footer</footer>
Using flex I have more or less accomplished what I want. But my questions are:
Is it possible to set a min-height to a flex-item, so that the flex
container increases beyond 100% height? As it is now, the info
container below the video and speaker container disappears when
browser is not tall enough.
Also, I seem to need to put flex-shrink to 0 for the
speaker-container div, or else it does not always show. But when
decreasing the browser height, this means that the
speaker-container (flex item) displays on top of the footer. How
can I avoid that?
The issue that CSS flexbox doesn't work properly in IE 10 and below probably
means I cannot accomplish this kind of layout for those
browsers? Some users will use IE9/IE10 so I would either need a fallback or they'd have to accept only having a page scroll.

Related

Entire body tag skewing to the left on mobile, other elements not affected

I know this question has been asked 100 million times... but I am truly at a loss as to why this is happening. I have a simple website with a header, a 'hero' section and a div of the body content. Everything with the layout is fine except for when I go under around 600 pixels in the responsive view in Chrome. The 'hero' image starts to skew heavily to the left as if there is something off the screen pulling it. I checked to make sure there were no margins or fixed width elements and there is none that could be causing this (the only fixed width element is an image that is around 300px). While troubleshooting, it appears that the entire body tag is the correct width as the viewport but is being pushed to the left as the screen is made smaller.
That being said, the 'content' div is not being skewed to the left and a last minute fix I came up with was putting the hero section inside the body content div. But this is not ideal because I need them to be separate for styling reasons.
I did Google around quite a bit to see why this is happening. I tried adding 'overflow: hidden' to the body and html tags. It helped a little bit, but the problem persisted as I made the width smaller. I also added 'margin:0', 'width: 100%' to the body, html and hero container tags and it didn't do anything.
One possible issue is the size of the hero image, but I'm not sure why there would be so much white space to the right if it's too big.
Here is the HTML for the website:
<body>
<header class="header">
<nav>
<a href="#" class="header__logo">
<img src="images/logo_nostroke.png" alt="Header logo" />
</a>
<a href="#" class="header__hamburger_menu">
<span class="bar one"></span>
<span class="bar two"></span>
<span class="bar three"></span>
</a>
<ul class="header__links">
<li class="nav_item">
About
</li>
<li class="nav_item">
Clinical Work
</li>
<li class="nav_item">
<a href="#consultation_supervision"
>Consultation and <br />Supervision</a
>
</li>
<li class="nav_item">
Writing Projects
</li>
<li class="nav_item">
Resources
</li>
</ul>
</nav>
</header>
<section class="hero">
<div class="hero__image"></div>
<div class="hero__text">
<h2 class="quote">
“Without community there is no liberation” – Audre Lorde
</h2>
Nullam euismod eget ex eget hendrerit. Proin pharetra mi dolor, et fermentum velit
porttitor in. Proin lacinia metus in erat suscipit, non auctor lacus cursus. Vivamus
ullamcorper, felis id pretium vulputate, urna ligula finibus ante, sit amet accumsan
nisl lorem eu tortor. Donec finibus semper tellus ut pellentesque. Vestibulum at
imperdiet eros. Nam vel nibh vitae nisl consequat varius ac a leo. Quisque ut ligula
tincidunt, dignissim mi eu, eleifend augue. Aenean hendrerit egestas nibh non
faucibus. In malesuada nunc nec diam rutrum facilisis. Cras porta velit ut bibendum
maximus. Orci varius natoque penatibus et magnis dis parturient montes, nascetur
ridiculus mus.
</div>
</section>
<div class="content">
<div class="about" id="about">
<div class="portrait_img">
<img
src="images/portrait_image.jpg"
alt="image of reese."
class="portrait"
/>
</div>
<div class="p1">
<h2 class="strong_title">About me...</h2>
<span class="bold">Welcome!</span> Nam mollis nisi turpis, gravida varius nibh tempus a. In magna risus, pretium non magna eu, rutrum suscipit nisl. Donec laoreet ante non nisi tincidunt, sed bibendum est commodo. Nunc sollicitudin laoreet dui. Cras vel volutpat turpis, eget vulputate nulla. Phasellus tincidunt maximus eros eu ultrices. In diam velit, lobortis ac scelerisque ac, sollicitudin sed ipsum. Vivamus non lorem nec libero vehicula condimentum quis placerat lacus. Maecenas id nibh a risus eleifend venenatis et sed metus. Fusce lobortis lectus augue, quis cursus magna ullamcorper sed.
</div>
</div>
<div class="clinical_work content_box" id="clinical_work">
<div class="p2">
<h2 class="strong_title">Clinical Work</h2>
<hr width="500px;" color="black" size="3" align="left" />
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eu condimentum
nunc. Aliquam erat nunc, aliquam molestie velit a, lobortis hendrerit eros.
Pellentesque et maximus sem, porta volutpat nibh. Pellentesque a feugiat tellus,
id placerat tellus. Pellentesque habitant morbi tristique senectus et netus et
malesuada fames ac turpis egestas. Pellentesque vulputate lorem eu ipsum
facilisis, id tristique orci ultrices. Fusce ac ornare nibh. Nullam commodo et
neque sed varius. Cras nulla enim, bibendum eget euismod vel, rhoncus eget arcu.
Nulla facilisi. Vivamus imperdiet mi nec nibh semper sollicitudin. Nunc sed purus
quis tortor vulputate cursus. Vivamus massa sapien, faucibus et pulvinar at,
gravida a nulla. Vivamus auctor egestas scelerisque.
</div>
</div>
</div>
<script src="script.js"></script>
</body>
Here is the SCSS for the hero section:
.hero {
&__image {
background-image: url("../images/heroimage_fadeout.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center bottom;
min-height: 110vh;
width: 100%;
position: relative;
}
&__text {
position: absolute;
bottom: 50px;
padding: 1em;
margin-left: 10em;
margin-right: 10em;
text-align: center;
background-color: #f8f069;
border: solid black;
font-size: 1.2em;
}
}
And here is the SCSS for the body content section that is perfectly placed on the site:
.content {
padding: 1.6em;
#include breakpoint-up(large) {
margin: 0 0 5rem;
}
#include breakpoint-down(small) {
padding: 5em 1em 1em 1em;
width: fit-content;
}
.about {
display: grid;
grid-template-columns: 1fr 2fr;
margin: 13em 18em 3em;
padding: 2em 3em 1em 3em;
border: black solid;
background-color: #f8f069;
#include breakpoint-down(medium) {
grid-row-gap: 0px;
grid-template-columns: 1fr;
grid-template-rows: auto;
padding: 0;
margin: 0;
}
#include btw-mobile-desktop {
margin: 1em 4em;
padding: 2em;
}
.portrait_img {
align-self: end;
justify-self: center;
margin-right: 1em;
#include breakpoint-down(small) {
grid-area: auto;
align-self: center;
justify-self: center;
padding: 0.3em;
}
#include btw-mobile-desktop {
justify-self: center;
align-self: center;
}
.portrait {
max-width: 300px;
#include breakpoint-down(small) {
max-width: 230px;
}
}
}
.p1 {
align-self: end;
#include breakpoint-down(small) {
grid-area: auto;
justify-self: center;
padding: 0em 1em 0em 1em;
}
.strong_title {
font-size: 3em;
margin: 0;
#include breakpoint-down(small) {
text-align: center;
font-size: 2.6em;
}
}
}
}
}
.bold {
font-weight: bolder;
font-size: 1.4rem;
}
.content_box {
margin: 13em 18em 3em;
padding: 3em;
border: black solid;
background-color: #f8f069;
#include breakpoint-down(medium) {
padding: 1em;
margin: 2em 0;
}
#include btw-mobile-desktop {
margin: 1em 4em;
padding: 2em;
}
.strong_title {
font-size: 3em;
margin: 0;
}
}
Here is a picture of the problem. Please ignore the very thin text box with the words scribbled out. That is the next issue I was going to fix on mobile. The issue is the hero image behind the text box being skewed:
HTML:
<div class="img-wrapper">
<div class="hero__image"></div>
</div>
instead of :
<div class="hero__image"></div>
in css remove width:100%; for the image
and add these styles for the wrapper
.img-wrapper{
width: 100%;
overflow-x:hidden;
height: max-content;
}
SOLVED:
There were elements in the code that were forcing the layout be too wide.
The first problem was the 'hr' tag in the clinical work div.
Also the margins on the hero text were not responsive.
Solution:
Adding in responsive sizing to the hr tag in CSS.
Set the width of the hero__text to a percentage of the screen and then center it horizontally with transform:translate.
transform: translate(-50%);
margin-left: 50%;

How to make 4 columns with images & text inside, and set links for each columns in the same line?

I am making a website on the basis of a PSD file. I want to create the website using a flexbox layout.
I don't know how to make 4 columns in flexbox to be able to wrap nicely.
I want to make something like on the image:
.container {
display: flex;
justify-content: center;
flex-wrap: wrap;
max-width: 100%;
}
.resources {
background-color: #a2ca28;
}
.info {
padding-top: 40px;
padding-bottom: 40px;
}
.info > * {
flex-basis: 20%;
padding: 20px;
}
.info article img {
height: 4em;
}
.info article h2 {
font-size: 24px;
font-weight: 400;
line-height: 54.1px;
}
.info article p {
font-family: "Proxima Nova";
font-size: 14px;
font-weight: 400;
line-height: 24px;
}
<section class='resources'>
<div class='container info'>
<article>
<img src="./images/resources.png" >
<h2>Resources</h2>
<p>Donec porttitor augue sit amet est posuere facilisis. Pellentesque
habitant morbi tristique senectus et netus et malesuada fames ac
turpis egestas. Fusce malesuada ipsum augue, quis viverra orci ultricies
at. Etiam commodo purus nisi. Aenean vestibulum mi in mi consequat, vel semper orci efficitur.</p>
<a href='#'>Explore more</a>
</article>
<article>
<img src="./images/trainingfunding.png" >
<h2>Training & Funding </h2>
<p>Quisque vel ultrices elit. Phasellus nunc libero, dictum id purus a,
semper volutpat arcu. Integer pretium, tortor at facilisis sollicitudin,
ex velit faucibus dolor, ut finibus dolor neque at odio.</p>
<a href='#'>Explore more</a>
</article>
<article>
<img src="./images/connect.png" >
<h2>Connect</h2>
<p>Quisque quis nulla dignissim, consectetur libero sed, semper risus.
Quisque tincidunt, elit sit amet volutpat tincidunt, velit dolor
varius nisl, ut tristique orci diam et elit. Nam congue sem nunc,
ac fermentum leo consectetur in. </p>
<a href='#'>Explore more</a>
</article>
<article>
<img src="./images/communicate.png" >
<h2>Communicate</h2>
<p>Maecenas sit amet felis et leo consectetur efficitur.
Vestibulum gravida felis nec malesuada pulvinar.</p>
<a href='#'>Explore more</a>
</article>
</div>
</section>
Added/Updated the following styles
* {
box-sizing: border-box;
}
.container {
display: flex;
justify-content: center;
flex-wrap: wrap;
max-width: 100%;
}
.container article {
width: 25%;
padding: 10px;
position: relative;
}
article a {
position: absolute;
bottom: 0;
}
#media (max-width: 900px) {
.container article {
width: 50%;
}
}
#media (max-width: 768px) {
.container article {
width: 100%;
}
}
* {
box-sizing: border-box;
}
.container {
display: flex;
justify-content: center;
flex-wrap: wrap;
max-width: 100%;
}
.resources {
background-color: #a2ca28;
}
.info {
padding-top: 40px;
padding-bottom: 40px;
}
.container article {
width: 25%;
padding: 10px;
position: relative;
}
article a {
position: absolute;
bottom: 0;
}
.info article img {
height: 4em;
}
.info article h2 {
font-size: 24px;
font-weight: 400;
line-height: 54.1px;
}
.info article p {
font-family: "Proxima Nova";
font-size: 14px;
font-weight: 400;
line-height: 24px;
}
#media (max-width: 900px) {
.container article {
width: 50%;
}
}
#media (max-width: 768px) {
.container article {
width: 100%;
}
}
<section class='resources'>
<div class='container info'>
<article>
<img src="./images/resources.png">
<h2>Resources</h2>
<p>Donec porttitor augue sit amet est posuere facilisis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Fusce malesuada ipsum augue, quis viverra orci ultricies at. Etiam commodo purus nisi. Aenean vestibulum
mi in mi consequat, vel semper orci efficitur.</p>
<a href='#'>Explore more</a>
</article>
<article>
<img src="./images/trainingfunding.png">
<h2>Training & Funding </h2>
<p>Quisque vel ultrices elit. Phasellus nunc libero, dictum id purus a, semper volutpat arcu. Integer pretium, tortor at facilisis sollicitudin, ex velit faucibus dolor, ut finibus dolor neque at odio.</p>
<a href='#'>Explore more</a>
</article>
<article>
<img src="./images/connect.png">
<h2>Connect</h2>
<p>Quisque quis nulla dignissim, consectetur libero sed, semper risus. Quisque tincidunt, elit sit amet volutpat tincidunt, velit dolor varius nisl, ut tristique orci diam et elit. Nam congue sem nunc, ac fermentum leo consectetur in. </p>
<a href='#'>Explore more</a>
</article>
<article>
<img src="./images/communicate.png">
<h2>Communicate</h2>
<p>Maecenas sit amet felis et leo consectetur efficitur. Vestibulum gravida felis nec malesuada pulvinar.</p>
<a href='#'>Explore more</a>
</article>
</div>
</section>

CSS: On hover hide div and show image at the same time?

A similar question has been asked but it didn't provide a solution for my issue. CSS: On hover show and hide different div's at the same time?
I want to hide a div and display an image in the center of the page at the same time when I hover over my list items.
I tried this but it the second div in the middle of the page still shows on hover.
/* absorbing paddings within the div's width, instead of adding it
on top */
* {
box-sizing: border-box;
}
#container {
width: 100%;
}
header {
padding-top: 10px;
}
h1 {
text-align: center;
font-size: 150%;
}
.a {
width: 7%;
height: 48px;
}
.b {
width: 45%;
height: 48px;
}
.a,
.b {
display: inline-block;
vertical-align: top;
padding: 5px;
padding-top: 10px;
margin: 5px;
margin-right: 195px;
}
.a,
ul {
list-style: none;
line-height: 150%;
padding-top: 15px
}
li a {
text-decoration: none;
color: inherit;
}
.b,
h2 {
text-align: center;
}
.projectImage {
display: none;
}
.a:hover .projectImage {
display: block;
}
.a:hover .b {
display: none;
}
.a,
.image1:hover .projectImage {}
<div id="container">
<header id="title">
<h1>Lorem Ipsum</h1>
</header>
<div class="a">
<ul class="projectList">
<li class="projectImage">Project<span><img class="image1" src="" alt="" height="" /></span></li>
<li>Project<span><img src="" alt="" height="" /></span></li>
<li>Project<span><img src="" alt="" height="" /></span></li>
<li>Project<span><img src="" alt="" height="" /></span></li>
<li>Project<span><img src="" alt="" height="" /></span></li>
<li>Project<span><img src="" alt="" height="" /></span></li>
<li>Project<span><img src="" alt="" height="" /></span></li>
</ul>
</div>
<div class="b">
<h2>lorem ipsum</h2>
<p>Lorem ipsum dolor sit amet, suspendisse nam habitasse pellentesque arcu quae dignissim, amet magna diam aenean. Amet ipsum aenean, massa posuere maecenas nam lectus nibh lacus, nisl lacus magna nullam leo quis. Mi elit ante nunc, mi odio congue rhoncus
dui quis dictum, lectus eleifend aliquam sed venenatis vitae lorem, potenti non dictum sit. Condimentum nonummy vitae tristique, pede nullam pretium arcu vestibulum dictum, urna erat aliquam duis sit pede nam. Morbi mauris fermentum luctus morbi
nec eget, vitae fermentum et maecenas, primis ullamcorper mauris et diam nunc, turpis massa sit felis nullam.</p>
<p>Interdum morbi pellentesque. Et semper diam vestibulum, nisl est, porttitor mauris tellus hac, ut dictum massa. Elementum malesuada curabitur non euismod arcu, sit justo suspendisse aliquam purus suspendisse. Felis est leo, quis turpis ornare quis
tellus, fusce neque ut vitae justo penatibus molestie, per labore suscipit corrupti, non sed in id amet velit. Tempor rutrum tristique anim orci massa, arcu dolor eros dictum arcu.</p>
</div>
</div>
https://codepen.io/jordan_miguel/pen/dWNbzL?editors=1100
Since element .a and element .b are right next to each other in the markup you have supplied, you probably want to use the sibling selector to target element .b. Simply change your last declaration block to:
.a:hover + .b {
display: none;
}
Here's an updated Codepen.
Hope this helps! Let me know if you have any questions.

Fixed position of top horizontal menu causes that the BODY longer than 100%

in my CSS example I've created a horizontal menu with 50px height. Also tried to use a sticky footer but the BODY is longer with the height of the top menu, and because of it a 50px big white place appeared on the bottom of the page under the Footer. [The problem exists on IE10. Not tested in other browsers yet.]
JSFiddle
html file:
<!doctype html>
<html>
<head>
<!-- Load jQuery from Google's CDN -->
<script src="jquery-1.9.1.js"></script>
<!-- Source our javascript file with the jQUERY code -->
<script src="script.js"></script>
<link rel="stylesheet" href="runnable.css" />
</head>
<body>
<div id="header">
<div id="headerline">
<div class="wrapper">
<ul class="navigation">
<li class="logo">
WebApp
</li>
<li class="tmenu">
<span class="menuItem">Site Events</span>
<ul class="smenu">
<li><span>Consulting</span></li>
<li><span>Sales</span></li>
<li><span>Support</span></li>
</ul>
</li>
<li class="tmenu">
<span class="menuItem">Text files</span>
<ul class="smenu">
<li>Company</li>
<li>Mission</li>
<li>Contact Information</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div id="content">
<div class="wrapper">
<div class="contentbox">
<h1>Welcome Message</h1>
<p class="date">3/31/2014 - 4:37 PM</p>
<p class="text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam vel dui tempus, iaculis arcu sit amet, porttitor turpis. Interdum et malesuada fames ac ante ipsum primis in faucibus. Sed eu quam mi. Morbi ac nulla eget diam commodo faucibus. Proin dignissim elit a ligula rhoncus, vitae viverra justo dignissim. In congue quam molestie, mollis ante sed, viverra urna. Pellentesque massa velit, eleifend a magna nec, vulputate gravida dui. Integer pulvinar id arcu ut faucibus. Phasellus vitae augue ac eros sollicitudin vehicula. Nunc aliquam leo a laoreet consequat. Fusce tristique mauris sed neque feugiat, id dignissim dui bibendum. Ut hendrerit commodo mi. Nunc pharetra, eros ut ultricies ultricies, erat lectus vehicula odio, vel suscipit odio nisi eu tellus. Integer interdum adipiscing gravida. Donec vitae neque diam. Mauris interdum eu nulla nec interdum.</p>
<p class="text">Vivamus eu quam ut felis hendrerit mattis ac nec urna. Maecenas erat felis, gravida ut porttitor at, congue eget mauris. Phasellus interdum dolor sem, et gravida massa scelerisque ac. Pellentesque non rhoncus orci. Quisque viverra tellus justo, eu congue mi mattis eget. Fusce a nulla urna. Fusce et mauris eget lorem lacinia sollicitudin. Fusce condimentum neque quis est tristique,aliquet dui sodales.</p>
<p class="text">Donec at velit nec nibh porttitor auctor quis non ipsum. Vestibulum condimentum viverra mattis. Praesent sed quam ultricies magna tempor tristique. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed venenatis nulla eget sapien hendrerit vulputate. Donec sed libero justo. Aliquam diam felis, feugiat ac vulputate vel, iaculis at lorem. Nam facilisis lacus nec turpis bibendum, sit amet rutrum eros ultrices. </p>
<p class="text">Quisque quis scelerisque risus. Fusce a lacinia velit, non vestibulum ipsum. Donec nunc ipsum, semper quis sagittis nec, facilisis id felis. Morbi eget magna volutpat, adipiscing dui ac, elementum est. Curabitur sem diam, rhoncus in lorem eu, sodales eleifend sem. Etiam bibendum convallis fermentum. Donec ullamcorper pulvinar neque in auctor. Vestibulum tincidunt arcu vel orci molestie porta. Quisque quis commodo velit, eget vulputate nibh. Cras eu venenatis tellus. </p>
<p class="text">Duis ultricies accumsan euismod. Nulla pulvinar felis placerat vehicula rutrum. Etiam placerat vitae lacus nec laoreet. In nunc nibh, tincidunt sed dictum sit amet, ultrices vel enim. Nulla in urna molestie, pulvinar massa non, consectetur augue. Ut et ligula vitae libero vehicula mollis. Suspendisse nisl felis, pretium eget libero in, pharetra porttitor lectus. Nunc tincidunt nunc neque. Donec eget interdum ante. Pellentesque vehicula sapien eu lectus tempus interdum. Suspendisse pharetra purus id lectus cursus dapibus. Proin sed lorem dignissim, placerat est sit amet, blandit diam. Ut ut risus vitae neque sodales rhoncus nec ac massa. Fusce ac augue tincidunt, vulputate augue sit amet, varius tellus. Vivamus a tortor ipsum. Vestibulum in tellus neque.</p>
</div>
</div>
</div>
<div id="footer">
<div id="fback">
<div class="wrapper">
<div id="fContent">
<ul><p>Help</p>
<li>About WebApp</li>
<li>List Item</li>
<li>List Item</li>
<li>List Item</li>
<li>List Item</li>
<li>List Item</li>
<li>List Item</li>
<li>List Item</li>
</ul>
<ul><p>FAQ</p>
<li>Question</li>
<li>Question</li>
<li>Question</li>
</ul>
<ul><p>Contacts</p>
<li>Person</li>
<li>Person</li>
<li>Person</li>
<li>Person</li>
<li>Person</li>
<li>Person</li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>
CSS file:
* {
margin: 0;
padding: 0;
}
html {
height: 100%;
/*border: 2px solid red;*/
}
body {
font-family: arial;
text-align: center;
background:url(foo) fixed;
height: 100%;
/*border: 2px solid red;*/
}
div.wrapper {
width: 1100px;
margin: 0 auto;
padding: 0;
}
/*=== header ===*/
div#header {
text-align: center;
position: fixed;
_position: absolute;
top: 0;
left: 0;
_top:expression(eval(document.body.scrollTop));
display: block;
width: 100%;
}
div#headerline {
padding: 0;
margin: 0;
background: #e6e6e6;
height: 50px;
border-bottom: solid 1px #172740;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
}
ul.navigation li{
float: left;
}
ul.navigation a {
text-decoration: none;
display: block;
}
span.menuItem {
display: inline;
display: inline-table;
display: inline-block;
line-height: 68px;
}
li.logo {
font-family: tahoma;
font-size: 40px;
font-weight: bold;
}
li.logo a {
padding: 0;
height: 50px;
width: 180px;
text-align: left;
}
li.tmenu {
float: left;
width: 160px;
position: relative;
}
li.logo a, li.tmenu > a { /* ">" means the first level of this type of children*/
color: #172740;
text-shadow: 2px 2px white;
}
li.tmenu a {
width: 160px;
height: 50px;
}
li.tmenu > a {
font-weight: 600;
}
li.tmenu > a:hover {
font-weight: 900;
}
ul.smenu {
display: none;
position: absolute;
margin-left: 0px;
list-style: none;
padding: 0px;
background: #172740;
border: solid 1px #000;
}
ul.smenu, ul.smenu li {
width: 160px;
float: left;
}
ul.smenu a {
display: block;
height: 20px;
padding: 8px 0px;
color: #fff;
text-decoration: none;
text-align: center;
text-shadow: 1px 1px #000;
}
ul.smenu a:hover {
font-weight: bold;
}
/*=== content ===*/
div#content {
text-align: left;
/*position: relative;*/
min-height: 60%;
margin-top: 50px;
}
h1 {
padding: 0;
margin: 0;
padding-top: 50px;
color: #253e66;
font-size: 25px;
}
p.date {
font-size: 8px;
color: #aaa;
}
p.text {
font-size: 14px;
margin-bottom: 6px;
}
/*=== Footer ===*/
div#footer {
padding-top: 50px;
width: 100%;
min-height: 20%;
}
div#fback {
overflow: hidden;
padding: 0;
margin: 0;
background: #253e66;
text-align: center;
}
div#fContent {
color: #e6e6e6;
text-align: center;
}
div#fContent ul {
text-align: left;
float: left;
padding: 40px 70px 50px 0px;
font-size: 14px;
}
div#fContent ul > p {
font-weight: bold;
padding-bottom: 12px;
}
div#fContent li {
padding-bottom: 3px;
}
/*=== Copyright content ===*/
JS file:
$(document).ready(
/* This is the function that will get executed after the DOM is fully loaded */
function () {
/* Next part of code handles hovering effect and submenu appearing */
$('.tmenu').hover(
function () { //appearing on hover
$('ul', this).fadeIn();
},
function () { //disappearing on hover
$('ul', this).fadeOut();
}
);
}
);
Also weird that, if I set a border on the BODY, big part of the white space is disappear. Please help me out, what I've messed in the CSS, and how can I repair my code. Thanks a lot in advance.
sorry the was indeed a problem didnt understand the question.
I changed div#fContent ul from:
div#fContent ul {
text-align: left;
float: left;
padding: 40px 70px 50px 0px;
font-size: 14px;
}
to:
div#fContent ul {
text-align: left;
float: left;
padding: 40px 70px 0px 0px;
font-size: 14px;
}
Good luck. Check the fiddle and let me know:
DEMO
don't quote me on this please... but I think that the the paragraph element gives white space so to remove this make its margin 0px. Hope it's the right answer if not please comment back MontyX. thanks

Bootstrap 3 Slide in Menu / Navbar on Mobile [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I am building a browser-based mobile app and I've decided to use Bootstrap 3 as the css framework for the design. Bootstrap 3 comes with a great "responsive" feature in the navigation bar where it collapses automatically if it detects a specific "break point" regarding the resolution of the browser. It works in a lot of situations.
But have you noticed lately how a lot of browser-based mobile apps have the primary navigation hidden out of the left of the screen, and when the toggle icon is pressed (toggled) in the top-right corner, the primary navigation slides out to the right about 2/3 of the way into the screen? This is an increasingly popular solution for navigating through browser-based apps on mobile devices and I think in theory it should be pretty easy to modify bootstrap css/js to accommodate this version of the navigation collapse feature.
How can these feature be implemented? It seems like it shouldn't take too much modification. I'd really like to hear your thoughts/solutions on this matter. Also, I think it would be a great long-term solution for Bootstrap to implement as a built-in feature.
Unfortunately I have not made any attempts to create this feature because while I am familiar with these technologies, I am predominantly a PHP/MySQL developer and I believe a feature as useful as this should be built by experts with insight that I don't have as a front-end developer.
This was for my own project and I'm sharing it here too.
DEMO: http://jsbin.com/OjOTIGaP/1/edit
This one had trouble after 3.2, so the one below may work better for you:
https://jsbin.com/seqola/2/edit --- BETTER VERSION, slightly
CSS
/* adjust body when menu is open */
body.slide-active {
overflow-x: hidden
}
/*first child of #page-content so it doesn't shift around*/
.no-margin-top {
margin-top: 0px!important
}
/*wrap the entire page content but not nav inside this div if not a fixed top, don't add any top padding */
#page-content {
position: relative;
padding-top: 70px;
left: 0;
}
#page-content.slide-active {
padding-top: 0
}
/* put toggle bars on the left :: not using button */
#slide-nav .navbar-toggle {
cursor: pointer;
position: relative;
line-height: 0;
float: left;
margin: 0;
width: 30px;
height: 40px;
padding: 10px 0 0 0;
border: 0;
background: transparent;
}
/* icon bar prettyup - optional */
#slide-nav .navbar-toggle > .icon-bar {
width: 100%;
display: block;
height: 3px;
margin: 5px 0 0 0;
}
#slide-nav .navbar-toggle.slide-active .icon-bar {
background: orange
}
.navbar-header {
position: relative
}
/* un fix the navbar when active so that all the menu items are accessible */
.navbar.navbar-fixed-top.slide-active {
position: relative
}
/* screw writing importants and shit, just stick it in max width since these classes are not shared between sizes */
#media (max-width:767px) {
#slide-nav .container {
margin: 0;
padding: 0!important;
}
#slide-nav .navbar-header {
margin: 0 auto;
padding: 0 15px;
}
#slide-nav .navbar.slide-active {
position: absolute;
width: 80%;
top: -1px;
z-index: 1000;
}
#slide-nav #slidemenu {
background: #f7f7f7;
left: -100%;
width: 80%;
min-width: 0;
position: absolute;
padding-left: 0;
z-index: 2;
top: -8px;
margin: 0;
}
#slide-nav #slidemenu .navbar-nav {
min-width: 0;
width: 100%;
margin: 0;
}
#slide-nav #slidemenu .navbar-nav .dropdown-menu li a {
min-width: 0;
width: 80%;
white-space: normal;
}
#slide-nav {
border-top: 0
}
#slide-nav.navbar-inverse #slidemenu {
background: #333
}
/* this is behind the navigation but the navigation is not inside it so that the navigation is accessible and scrolls*/
#slide-nav #navbar-height-col {
position: fixed;
top: 0;
height: 100%;
width: 80%;
left: -80%;
background: #eee;
}
#slide-nav.navbar-inverse #navbar-height-col {
background: #333;
z-index: 1;
border: 0;
}
#slide-nav .navbar-form {
width: 100%;
margin: 8px 0;
text-align: center;
overflow: hidden;
/*fast clearfixer*/
}
#slide-nav .navbar-form .form-control {
text-align: center
}
#slide-nav .navbar-form .btn {
width: 100%
}
}
#media (min-width:768px) {
#page-content {
left: 0!important
}
.navbar.navbar-fixed-top.slide-active {
position: fixed
}
.navbar-header {
left: 0!important
}
}
HTML
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation" id="slide-nav">
<div class="container">
<div class="navbar-header">
<a class="navbar-toggle">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="navbar-brand" href="#">Project name</a>
</div>
<div id="slidemenu">
<form class="navbar-form navbar-right" role="form">
<div class="form-group">
<input type="search" placeholder="search" class="form-control">
</div>
<button type="submit" class="btn btn-primary">Search</button>
</form>
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>About</li>
<li>Contact</li>
<li class="dropdown"> Dropdown <b class="caret"></b>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li>Separated link</li>
<li>One more separated link</li>
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li>Separated link</li>
<li>One more separated link</li>
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider"></li>
<li class="dropdown-header">Nav header</li>
<li>Separated link test long title goes here</li>
<li>One more separated link</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
jQuery
$(document).ready(function () {
//stick in the fixed 100% height behind the navbar but don't wrap it
$('#slide-nav.navbar .container').append($('<div id="navbar-height-col"></div>'));
// Enter your ids or classes
var toggler = '.navbar-toggle';
var pagewrapper = '#page-content';
var navigationwrapper = '.navbar-header';
var menuwidth = '100%'; // the menu inside the slide menu itself
var slidewidth = '80%';
var menuneg = '-100%';
var slideneg = '-80%';
$("#slide-nav").on("click", toggler, function (e) {
var selected = $(this).hasClass('slide-active');
$('#slidemenu').stop().animate({
left: selected ? menuneg : '0px'
});
$('#navbar-height-col').stop().animate({
left: selected ? slideneg : '0px'
});
$(pagewrapper).stop().animate({
left: selected ? '0px' : slidewidth
});
$(navigationwrapper).stop().animate({
left: selected ? '0px' : slidewidth
});
$(this).toggleClass('slide-active', !selected);
$('#slidemenu').toggleClass('slide-active');
$('#page-content, .navbar, body, .navbar-header').toggleClass('slide-active');
});
var selected = '#slidemenu, #page-content, body, .navbar, .navbar-header';
$(window).on("resize", function () {
if ($(window).width() > 767 && $('.navbar-toggle').is(':hidden')) {
$(selected).removeClass('slide-active');
}
});
});
Bootstrap 5 Beta 3 (update 2021)
Introducing the new Bootstrap 5 Offcanvas Component
Bootstrap 4
Create a responsive navbar sidebar "drawer" in Bootstrap 4?
Bootstrap horizontal menu collapse to sidemenu
Bootstrap 3
I think what you're looking for is generally known as an "off-canvas" layout. Here is the standard off-canvas example from the official Bootstrap docs: http://getbootstrap.com/examples/offcanvas/
The "official" example uses a right-side sidebar the toggle off and on separately from the top navbar menu. I also found these off-canvas variations that slide in from the left and may be closer to what you're looking for..
http://www.bootstrapzero.com/bootstrap-template/off-canvas-sidebar
http://www.bootstrapzero.com/bootstrap-template/facebook
Without Plugin, we can do this; bootstrap multi-level responsive menu for mobile phone with slide toggle for mobile:
$('[data-toggle="slide-collapse"]').on('click', function() {
$navMenuCont = $($(this).data('target'));
$navMenuCont.animate({
'width': 'toggle'
}, 350);
$(".menu-overlay").fadeIn(500);
});
$(".menu-overlay").click(function(event) {
$(".navbar-toggle").trigger("click");
$(".menu-overlay").fadeOut(500);
});
// if ($(window).width() >= 767) {
// $('ul.nav li.dropdown').hover(function() {
// $(this).find('>.dropdown-menu').stop(true, true).delay(200).fadeIn(500);
// }, function() {
// $(this).find('>.dropdown-menu').stop(true, true).delay(200).fadeOut(500);
// });
// $('ul.nav li.dropdown-submenu').hover(function() {
// $(this).find('>.dropdown-menu').stop(true, true).delay(200).fadeIn(500);
// }, function() {
// $(this).find('>.dropdown-menu').stop(true, true).delay(200).fadeOut(500);
// });
// $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) {
// event.preventDefault();
// event.stopPropagation();
// $(this).parent().siblings().removeClass('open');
// $(this).parent().toggleClass('open');
// $('b', this).toggleClass("caret caret-up");
// });
// }
// $(window).resize(function() {
// if( $(this).width() >= 767) {
// $('ul.nav li.dropdown').hover(function() {
// $(this).find('>.dropdown-menu').stop(true, true).delay(200).fadeIn(500);
// }, function() {
// $(this).find('>.dropdown-menu').stop(true, true).delay(200).fadeOut(500);
// });
// }
// });
var windowWidth = $(window).width();
if (windowWidth > 767) {
// $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) {
// event.preventDefault();
// event.stopPropagation();
// $(this).parent().siblings().removeClass('open');
// $(this).parent().toggleClass('open');
// $('b', this).toggleClass("caret caret-up");
// });
$('ul.nav li.dropdown').hover(function() {
$(this).find('>.dropdown-menu').stop(true, true).delay(200).fadeIn(500);
}, function() {
$(this).find('>.dropdown-menu').stop(true, true).delay(200).fadeOut(500);
});
$('ul.nav li.dropdown-submenu').hover(function() {
$(this).find('>.dropdown-menu').stop(true, true).delay(200).fadeIn(500);
}, function() {
$(this).find('>.dropdown-menu').stop(true, true).delay(200).fadeOut(500);
});
$('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) {
event.preventDefault();
event.stopPropagation();
$(this).parent().siblings().removeClass('open');
$(this).parent().toggleClass('open');
// $('b', this).toggleClass("caret caret-up");
});
}
if (windowWidth < 767) {
$('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) {
event.preventDefault();
event.stopPropagation();
$(this).parent().siblings().removeClass('open');
$(this).parent().toggleClass('open');
// $('b', this).toggleClass("caret caret-up");
});
}
// $('.dropdown a').append('Some text');
#media only screen and (max-width: 767px) {
#slide-navbar-collapse {
position: fixed;
top: 0;
left: 15px;
z-index: 999999;
width: 280px;
height: 100%;
background-color: #f9f9f9;
overflow: auto;
bottom: 0;
max-height: inherit;
}
.menu-overlay {
display: none;
background-color: #000;
bottom: 0;
left: 0;
opacity: 0.5;
filter: alpha(opacity=50);
/* IE7 & 8 */
position: fixed;
right: 0;
top: 0;
z-index: 49;
}
.navbar-fixed-top {
position: initial !important;
}
.navbar-nav .open .dropdown-menu {
background-color: #ffffff;
}
ul.nav.navbar-nav li {
border-bottom: 1px solid #eee;
}
.navbar-nav .open .dropdown-menu .dropdown-header,
.navbar-nav .open .dropdown-menu>li>a {
padding: 10px 20px 10px 15px;
}
}
.dropdown-submenu {
position: relative;
}
.dropdown-submenu .dropdown-menu {
top: 0;
left: 100%;
margin-top: -1px;
}
li.dropdown a {
display: block;
position: relative;
}
li.dropdown>a:before {
content: "\f107";
font-family: FontAwesome;
position: absolute;
right: 6px;
top: 5px;
font-size: 15px;
}
li.dropdown-submenu>a:before {
content: "\f107";
font-family: FontAwesome;
position: absolute;
right: 6px;
top: 10px;
font-size: 15px;
}
ul.dropdown-menu li {
border-bottom: 1px solid #eee;
}
.dropdown-menu {
padding: 0px;
margin: 0px;
border: none !important;
}
li.dropdown.open {
border-bottom: 0px !important;
}
li.dropdown-submenu.open {
border-bottom: 0px !important;
}
li.dropdown-submenu>a {
font-weight: bold !important;
}
li.dropdown>a {
font-weight: bold !important;
}
.navbar-default .navbar-nav>li>a {
font-weight: bold !important;
padding: 10px 20px 10px 15px;
}
li.dropdown>a:before {
content: "\f107";
font-family: FontAwesome;
position: absolute;
right: 6px;
top: 9px;
font-size: 15px;
}
#media (min-width: 767px) {
li.dropdown-submenu>a {
padding: 10px 20px 10px 15px;
}
li.dropdown>a:before {
content: "\f107";
font-family: FontAwesome;
position: absolute;
right: 3px;
top: 12px;
font-size: 15px;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<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="slide-collapse" data-target="#slide-navbar-collapse" 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="slide-navbar-collapse">
<ul class="nav navbar-nav">
<li>Link <span class="sr-only">(current)</span></li>
<li>Link</li>
<li class="dropdown">
Dropdown</span>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li>Separated link</li>
<li>One more separated link</li>
<li class="dropdown-submenu">
SubMenu 1</span>
<ul class="dropdown-menu">
<li>3rd level dropdown</li>
<li>3rd level dropdown</li>
<li>3rd level dropdown</li>
<li>3rd level dropdown</li>
<li>3rd level dropdown</li>
<li class="dropdown-submenu">
SubMenu 2</span>
<ul class="dropdown-menu">
<li>3rd level dropdown</li>
<li>3rd level dropdown</li>
<li>3rd level dropdown</li>
<li>3rd level dropdown</li>
<li>3rd level dropdown</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li>Link</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>Link</li>
<li class="dropdown">
Dropdown</span>
<ul class="dropdown-menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li>Separated link</li>
</ul>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<div class="menu-overlay"></div>
<div class="col-md-12">
<h1>Resize the window to see the result</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus non bibendum sem, et sodales massa. Proin quis velit vel nisl imperdiet rhoncus vitae id tortor. Praesent blandit tellus in enim sollicitudin rutrum. Integer ullamcorper, augue ut tristique
ultrices, augue magna placerat ex, ac varius mauris ante sed dui. Fusce ullamcorper vulputate magna, a malesuada nunc pellentesque sit amet. Donec posuere placerat erat, sed ornare enim aliquam vitae. Nullam pellentesque auctor augue, vel commodo
dolor porta ac. Sed libero eros, fringilla ac lorem in, blandit scelerisque lorem. Suspendisse iaculis justo velit, sit amet fringilla velit ornare a. Sed consectetur quam eget ipsum luctus bibendum. Ut nisi lectus, viverra vitae ipsum sit amet,
condimentum condimentum neque. In maximus suscipit eros ut eleifend. Donec venenatis mauris nulla, ac bibendum metus bibendum vel.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus non bibendum sem, et sodales massa. Proin quis velit vel nisl imperdiet rhoncus vitae id tortor. Praesent blandit tellus in enim sollicitudin rutrum. Integer ullamcorper, augue ut tristique
ultrices, augue magna placerat ex, ac varius mauris ante sed dui. Fusce ullamcorper vulputate magna, a malesuada nunc pellentesque sit amet. Donec posuere placerat erat, sed ornare enim aliquam vitae. Nullam pellentesque auctor augue, vel commodo
dolor porta ac. Sed libero eros, fringilla ac lorem in, blandit scelerisque lorem. Suspendisse iaculis justo velit, sit amet fringilla velit ornare a. Sed consectetur quam eget ipsum luctus bibendum. Ut nisi lectus, viverra vitae ipsum sit amet,
condimentum condimentum neque. In maximus suscipit eros ut eleifend. Donec venenatis mauris nulla, ac bibendum metus bibendum vel.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus non bibendum sem, et sodales massa. Proin quis velit vel nisl imperdiet rhoncus vitae id tortor. Praesent blandit tellus in enim sollicitudin rutrum. Integer ullamcorper, augue ut tristique
ultrices, augue magna placerat ex, ac varius mauris ante sed dui. Fusce ullamcorper vulputate magna, a malesuada nunc pellentesque sit amet. Donec posuere placerat erat, sed ornare enim aliquam vitae. Nullam pellentesque auctor augue, vel commodo
dolor porta ac. Sed libero eros, fringilla ac lorem in, blandit scelerisque lorem. Suspendisse iaculis justo velit, sit amet fringilla velit ornare a. Sed consectetur quam eget ipsum luctus bibendum. Ut nisi lectus, viverra vitae ipsum sit amet,
condimentum condimentum neque. In maximus suscipit eros ut eleifend. Donec venenatis mauris nulla, ac bibendum metus bibendum vel.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus non bibendum sem, et sodales massa. Proin quis velit vel nisl imperdiet rhoncus vitae id tortor. Praesent blandit tellus in enim sollicitudin rutrum. Integer ullamcorper, augue ut tristique
ultrices, augue magna placerat ex, ac varius mauris ante sed dui. Fusce ullamcorper vulputate magna, a malesuada nunc pellentesque sit amet. Donec posuere placerat erat, sed ornare enim aliquam vitae. Nullam pellentesque auctor augue, vel commodo
dolor porta ac. Sed libero eros, fringilla ac lorem in, blandit scelerisque lorem. Suspendisse iaculis justo velit, sit amet fringilla velit ornare a. Sed consectetur quam eget ipsum luctus bibendum. Ut nisi lectus, viverra vitae ipsum sit amet,
condimentum condimentum neque. In maximus suscipit eros ut eleifend. Donec venenatis mauris nulla, ac bibendum metus bibendum vel.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus non bibendum sem, et sodales massa. Proin quis velit vel nisl imperdiet rhoncus vitae id tortor. Praesent blandit tellus in enim sollicitudin rutrum. Integer ullamcorper, augue ut tristique
ultrices, augue magna placerat ex, ac varius mauris ante sed dui. Fusce ullamcorper vulputate magna, a malesuada nunc pellentesque sit amet. Donec posuere placerat erat, sed ornare enim aliquam vitae. Nullam pellentesque auctor augue, vel commodo
dolor porta ac. Sed libero eros, fringilla ac lorem in, blandit scelerisque lorem. Suspendisse iaculis justo velit, sit amet fringilla velit ornare a. Sed consectetur quam eget ipsum luctus bibendum. Ut nisi lectus, viverra vitae ipsum sit amet,
condimentum condimentum neque. In maximus suscipit eros ut eleifend. Donec venenatis mauris nulla, ac bibendum metus bibendum vel.
</p>
</div>
</body>
</html>
Reference JS fiddle

Resources