I swear I have checked quite thoroughly before posting this!
I am trying to center a FIXED div inside its parent div.
<div id="main">
<div id="fixed"></div>
</div>
CSS:
#main {
position: relative;
min-width: 400px; /* so it's fluid*/
background: #fff;
height: 100vh;
}
#fixed {
position: fixed;
/* center the div */
right: 0;
left: 0;
margin-right: auto;
margin-left: auto;
min-height: 10em;
width: 300px;
top: 0;
background-color: #af0000;
}
I wonder if it s possible to do with pure CSS. I can calculate the remaining space, divide it by two and change LEFT and RIGHT (i.e left: 6px; right: 6px; etc..) with JQuery but I'd like to avoid that if possible.
http://jsfiddle.net/PvfFy/980/
CSS calc() and vw (viewer width)
We can calculate measurements in CSS using this powerful addition to CSS, and combined with vw (and also vh) we can position elements quite precisely and responsively.
#main {
height: 200vh; /* force scrolling for demo */
}
#fixed {
position: fixed;
width: 300px;
height: 100px;
top: 50px;
left: calc( 50vw - 150px ); /* this is the magic */
background: blue;
}
<div id="main">
<div id="fixed"></div>
</div>
Since question was clarified (sorry for not paying closer attention)
Using position: sticky:
...will behave just like a relatively positioned element until the viewport scrolls...
Unfortunately it is (June 25, '17) less than well supported, but allows us to use margin: 0 auto; centering since #fixed is of a fixed width.
body {
margin: 0;
}
#main {
min-width: 400px; /* variable width */
width: 70vw; /* for demo */
height: 200vh;
background: rgba( 0, 255, 0, 0.2 );
}
#fixed {
position: sticky; /* this is the magic */
margin: 0 auto; /* along with this */
width: 300px;
height: 100px;
top: 50px;
background: cadetblue;
}
<div id="main">
<div id="fixed"></div>
</div>
#main {
position: relative;
min-width: 400px;
background: #fff;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
#fixed {
position: fixed;
min-height: 10em;
width: 300px;
background-color: #af0000;
}
<div id="main">
<div id="fixed"></div>
</div>
Edited answer.
I got this idea from Fred's answer. if it brings you closer go upvote his answer and not this one.
This doesn't seem to work in the viewer below unless you use fullscreen for some reason.
Maybe this will bring you closer.
You #main needs position: relative
And your #fixed needs position: sticky As well as top: 25% bottom: 25% left: 50% right: 50%
See example below:
/* start eesential CSS */
#main {
display: inline-block;
width: 30%;
min-height: 300vh;
height: auto;
position: relative;
float: right;
}
#fixed {
margin: 0 auto;
position: sticky;
top: 25%;
bottom: 25%;
left: 50%;
right: 50%;
}
/* end eesential CSS */
/* Start style fluff */
body {
margin: 0 auto;
}
#main {
background: darkred;
}
#fixed {
max-width: 100%;
height: 300px;
color: #999;
background: darkblue;
overflow-y: auto;
}
#fixed *,
#none-fixed * {
padding: 25px;
color: #999;
}
/* End style fluff */
<div id="main">
<div id="none-fixed">
<p>Lorem ipsum dolor sit amet, dolore persius at nam, ne audiam meliore quo. Vis no lobortis referrentur, ex per modo epicuri oportere. Ad primis pertinacia deterruisset eam Lorem ipsum dolor sit amet, an utinam dolorum vix, usu no sumo quaeque molestiae.
Pro mundi nemore at, tation ceteros repudiare ut eos. Usu latine ponderum deseruisse no, has doctus propriae cu. Et vim unum saepe, an commune adversarium duo. Mea ea legere doming probatus, alia mutat te ius. Lorem ipsum dolor sit amet, an utinam
dolorum vix, usu no sumo quaeque molestiae. Pro mundi nemore at, tation ceteros repudiare ut eos. Usu latine ponderum deseruisse no, has doctus propriae cu. Et vim unum saepe, an commune adversarium duo. Mea ea legere doming probatus, alia mutat
te ius. Lorem ipsum dolor sit amet, dolore persius at nam, ne audiam meliore quo. Vis no lobortis referrentur, ex per modo epicuri oportere. Ad primis pertinacia deterruisset eam Lorem ipsum dolor sit amet, an utinam dolorum vix, usu no sumo quaeque
molestiae. Pro mundi nemore at, tation ceteros repudiare ut eos. Usu latine ponderum deseruisse no, has doctus propriae cu. Et vim unum saepe, an commune adversarium duo. Mea ea legere doming probatus, alia mutat te ius. Lorem ipsum dolor sit amet,
an utinam dolorum vix, usu no sumo quaeque molestiae. Pro mundi nemore at, tation ceteros repudiare ut eos. Usu latine ponderum deseruisse no, has doctus propriae cu. Et vim unum saepe, an commune adversarium duo. Mea ea legere doming probatus,
alia mutat te ius.
</p>
</div>
<div id="fixed">
<p>Lorem ipsum dolor sit amet, dolore persius at nam, ne audiam meliore quo. Vis no lobortis referrentur, ex per modo epicuri oportere. Ad primis pertinacia deterruisset eam Lore molestiae. Pro mundi nemore at, tation
</p>
</div>
<div id="none-fixed">
<p>Lorem ipsum dolor sit amet, dolore persius at nam, ne audiam meliore quo. Vis no lobortis referrentur, ex per modo epicuri oportere. Ad primis pertinacia deterruisset eam Lorem ipsum dolor sit amet, an utinam dolorum vix, usu no sumo quaeque molestiae.
Pro mundi nemore at, tation ceteros repudiare ut eos. Usu latine ponderum deseruisse no, has doctus propriae cu. Et vim unum saepe, an commune adversarium duo. Mea ea legere doming probatus, alia mutat te ius. Lorem ipsum dolor sit amet, an utinam
dolorum vix, usu no sumo quaeque molestiae. Pro mundi nemore at, tation ceteros repudiare ut eos. Usu latine ponderum deseruisse no, has doctus propriae cu. Et vim unum saepe, an commune adversarium duo. Mea ea legere doming probatus, alia mutat
a deterruisset eam Lorem ipsum dolor sit amet, an utinam dolorum vix, usu no sumo quaeque molestiae. Pro mundi nemore at, tation ceteros repudiare ut eos. Usu latine ponderum deseruisse no, has doctus propriae cu. Et vim unum saepe, an commune adversarium
duo. Mea ea legere doming probatus, alia mutat te ius. Lorem ipsum dolor sit amet, an utinam dolorum vix, usu no sumo quaeque molestiae. Pro mundi nemore at, tation ceteros repudiare ut eos. Usu latine ponderum deseruisse no, has doctus propriae
cu. Et vim unum saepe, an commune adversarium duo. Mea ea legere doming probatus, alia mutat te ius. te ius.
</p>
</div>
<div id="none-fixed">
<p>Lorem ipsum dolor sit amet, dolore persius at nam, ne audiam meliore quo. Vis no lobortis referrentur, ex per modo epicuri oportere. Ad primis pertinacia deterruisset eam Lorem ipsum dolor sit amet, an utinam dolorum vix, usu no sumo quaeque molestiae.
Pro mundi nemore at, tation ceteros repudiare ut eos. Usu latine ponderum deseruisse no, has doctus propriae cu. Et vim unum saepe, an commune adversarium duo. Mea ea legere doming probatus, alia mutat te ius. Lorem ipsum dolor sit amet, an utinam
dolorum vix, usu no sumo quaeque molestiae. Pro mundi nemore at, tation ceteros repudiare ut eos. Usu latine ponderum deseruisse no, has doctus propriae cu. Et vim unum saepe, an commune adversarium duo. Mea ea legere doming probatus, alia mutat
te ius.
</p>
</div>
</div>
Here is a slightly silly (but working well and, unlike all the mentioned above pure CSS solutions- this one is a cross-browser one) solution with JQuery involved:
// getting initial data
var fixed = $('#fixed').width();;
var main = $('#main').width();
// getting left offset
var leftSpace = $('#main').offset().left;
// caltucating difference, dividing by two and adding left margin
var diff = (main - fixed) / 2 + leftSpace;
// updating CSS
$('#fixed').css('left', diff);
http://jsfiddle.net/PvfFy/983/
Related
I'm trying to achieve gradual text fading effect at the bottom of the scrollable block. Also there must be an image behind this block so simply placing color (opacity) gradient over this block won't do and mix-blend-mode must be used.
The block has the following structure:
<div id="stage"><img ...></div>
<div class="layer">
<h2>...</h2>
<div class="text">
<div class="scroll-box">
<div class="container">...</div>
::after
</div>
<div class="scroll-tools">...</div>
</div>
</div>
.container contains some text. .scroll-tools contain custom scrollbar elements (rail and thumb). Here's jsfiddle.
Almost everything there looks as it should. Except scrollbar's rail is invisible due to it being black and mix-blend-mode: screen being applied to .layer and scrollbar's thumb has wrong color.
To exclude scrollbar from being blended I tried applying mix-blend-mode to .scroll-box but for some reason this does not work.
Question1: Is it possible to achieve the same effect with text in my case without affecting scrollbar? How?
Question2: Why mix-blend-mode doesn't work when being applied to .scroll-box (or .text)?
Blend mode: screen is not the only trick in the box.
You can also use hard-light.
Using this one, the color to get transparency is gray. And white and black are preserved
.test {
width: 300px;
height: 300px;
mix-blend-mode: hard-light;
}
.box {
width: 100px;
height: 100px;
background-color: white;
display: inline-block;
}
.box:first-of-type {
background-color: black;
}
.bkg {
background-image: linear-gradient(to top, lightblue, tomato);
}
p {
position: relative;
}
p:after {
content: "";
position: absolute;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
background-image: linear-gradient(to bottom, transparent 20%, rgb(128, 128, 128) 80%);
}
<div class="bkg">
<div class="test">
<p>Lorem ipsum dolor sit amet, mel et timeam deseruisse. Ceteros repudiandae mel ad. Id tantas graece maiorum usu. Nonumes efficiendi ius te, ea harum dictas nam. Eos harum iriure regione ut. Est labitur iudicabit urbanitas et. Inermis verterem maiestatis</p><p>
</p><div class="box"></div>
<div class="box"></div>
</div>
</div>
This doesn't have cross browser support but it's fun to play with
I think it matches what you described.
With that being said, this is not really a functional answer.
.main {
height: 200px;
width:300px;
margin:0 auto;
text-align:justify;
}
.wrap {
max-height: 100%;
overflow: auto;
padding:20px;
}
.inner {
-webkit-mask-image:
linear-gradient(to top, rgba(0, 0, 0, 0)5%,/** <---- Use this to determine the cutoff point **/
rgba(0, 0, 0, .25), rgba(0, 0, 0, .5), rgba(0, 0, 0, .75), rgba(0, 0, 0, 1))
}
<div class="main">
<div class="wrap">
<div class="inner">Lorem ipsum dolor sit amet, mel et timeam deseruisse. Ceteros repudiandae mel ad. Id tantas graece maiorum usu. Nonumes efficiendi ius te, ea harum dictas nam. Eos harum iriure regione ut. Est labitur iudicabit urbanitas et. Inermis verterem maiestatis
duo ea, vix an nostrud veritus democritum, duo zril platonem ad. Cum aeque blandit appareat an, cum cu minim iusto, pro aperiam reformidans ne. Vix bonorum legimus cu, has iusto appareat eu. Etiam iracundia no has, quo velit definitiones an. Ne
quo causae interesset scribentur, et pri affert dicant, est erant noster semper ei. Ea euismod antiopam electram ius, vero homero insolens ius ad, vel prima zril id. Ius te error apeirian. Vidisse intellegebat est eu, ut mea epicurei deserunt pertinacia,
cu lorem atomorum eos. ipsum dolor sit amet, mel et timeam deseruisse. Ceteros repudiandae mel ad. Id tantas graece maiorum usu. Nonumes efficiendi ius te, ea harum dictas nam. Eos harum iriure regione ut. Est labitur iudicabit urbanitas et. Inermis
verterem maiestatis duo ea, vix an nostrud veritus democritum, duo zril platonem ad. Cum aeque blandit appareat an, cum cu minim iusto, pro aperiam reformidans ne. Vix bonorum legimus cu, has iusto appareat eu. Etiam iracundia no has, quo velit
definitiones an. Ne quo causae interesset scribentur, et pri affert dicant, est erant noster semper ei. Ea euismod antiopam electram ius, vero homero insolens ius ad, vel prima zril id. Ius te error apeirian. Vidisse intellegebat est eu, ut mea
epicurei deserunt pertinacia, cu lorem atomorum eos.</div>
</div>
</div>
I want to add animated or gify image(Doctor treating pateint) on my website background, can anyone please suggest me with some solution, its a single page website: http://bighealth.co.in/
you can do like this:
change the url to the gif you want
change background-size: cover; to modify the way you want to display
body{
background-image: url('https://www.nasa.gov/sites/default/files/thumbnails/image/dscovrepicmoontransitfull.gif');
/* background-size: cover; */
}
If you want "high definition" animation, you need to add video as a background, if you mean this, then you need to provide the video in 3 types (.mp4, .ogg (or .ovg), webm), actually .mp4 could be enough, but will not work 100% in all brwosers, anyway here is the code:
.fullscreen-bg {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;
z-index: -100;
}
.fullscreen-bg__video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
#media (min-aspect-ratio: 16/9) {
.fullscreen-bg__video {
height: 300%;
top: -100%;
}
}
#media (max-aspect-ratio: 16/9) {
.fullscreen-bg__video {
width: 300%;
left: -100%;
}
}
#media (max-width: 767px) {
.fullscreen-bg {
background: url('../img/videoframe.jpg') center center / cover no-repeat;
}
.fullscreen-bg__video {
display: none;
}
}
<div class="fullscreen-bg">
<video loop muted autoplay poster="img/videoframe.jpg" class="fullscreen-bg__video">
<source src="http://dev2.slicejack.com/fullscreen-video-demo/video/big_buck_bunny.mp4" type="video/mp4">
<source src="http://dev2.slicejack.com/fullscreen-video-demo/video/big_buck_bunny.ogv" type="video/ogg">
<source src="http://dev2.slicejack.com/fullscreen-video-demo/video/big_buck_bunny.webm" type="video/webm">
</video>
</div>
<div class="content">
<h1>Full screen HTML5 video background</h1>
<p>Lorem ipsum dolor sit amet, vix te quidam commodo placerat. Mei ne dicunt minimum disputationi, purto everti adolescens id cum, quis veritus cotidieque eum ex. Ea eirmod atomorum posidonium sed, splendide dissentiunt an mel. Dolorem suavitate voluptatibus pro no. No duo conceptam cotidieque.</p>
<p>Pro novum argumentum ad. Vix at inani civibus, congue veritus probatus ad vel. Eam ne quis omnesque euripidis, pri ea dicat etiam ponderum. At sit harum dolor persius, eos vocent adipisci ad, magna movet audiam pri no. Erant labores incorrupte id sit, constituto scripserit theophrastus quo no.</p>
<p>Nam tacimates laboramus cu. Graeco tritani mel no. Iriure constituam mea te, quo integre salutatus ne. Case tota dicam te eam, quis minim assentior ei cum, sea eu verterem liberavisse. Modus officiis fabellas ea eos, in vis omittam ocurreret. Ea labitur assentior vix.</p>
<p>Case tation integre sit an. Te cum mollis vocent similique, docendi volumus eu nam. Erant euismod partiendo nec ei. Vel malorum liberavisse cu. Fabulas efficiantur in duo.</p>
<p>Ad qui brute fabulas rationibus, ex virtute omnesque vituperata vix. Ne case verterem probatus sit. In eam nulla tation debitis, has te alterum equidem definiebas. At summo facilisis eum. Vel ad nostro discere oportere, ad quod vitae officiis quo.</p>
<p>Case tation integre sit an. Te cum mollis vocent similique, docendi volumus eu nam. Erant euismod partiendo nec ei. Vel malorum liberavisse cu. Fabulas efficiantur in duo.Ad qui brute fabulas rationibus, ex virtute omnesque vituperata vix. Ne case verterem probatus sit. In eam nulla tation debitis, has te alterum equidem definiebas. At summo facilisis eum. Vel ad nostro discere oportere, ad quod vitae officiis quo.</p>
</div>
(click full page version to see the code running well, if run snippet not worked here, or visit the original source here)
The source of this code and more description provided here: https://slicejack.com/fullscreen-html5-video-background-css/
This works in FF/Chrome/Opera, and IE 10+, but not IE9; I'm looking for an IE9 solution
The following CSS will to make a set of divs, span, or p tags self-organize into neat columns that can be scrolled horizontally (Only works in WebKit enabled browsers).
-webkit-column-fill: auto;
-webkit-column-width: 300px;
-webkit-column-gap: 40px;
-moz-column-fill: auto;
-moz-column-width: 300px;
-moz-column-gap: 40px;
Here is the example:
$(document).ready(function() {
$(".RightArrow ").click(function() {
$(".columns").animate({
scrollLeft: '+=500'
}, 100);
});
$(".LeftArrow ").click(function() {
$(".columns").animate({
scrollLeft: '-=500'
}, 100);
});
}); //end script
body {
font-family: arial;
}
.columns {
overflow: hidden;
width: 500px;
border: 1px solid #000;
-webkit-column-fill: auto;
-webkit-column-width: 300px;
-webkit-column-gap: 40px;
-moz-column-fill: auto;
-moz-column-width: 300px;
-moz-column-gap: 40px;
padding: 0 20px;
text-align: left;
height: 500px;
overflow: hidden;
position: relative;
}
.notsectable {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: -moz-none;
-o-user-select: none;
user-select: none;
}
.arrows {
width: 500px;
}
.RightArrow {
float: right;
cursor: pointer;
}
.LeftArrow {
float: left;
cursor: pointer;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="columns">
<p>
<a class="">
<h2>
<span class="">1</span>
NUM 1
</h2>
<h3>200 Broadway</h3>
<p>This transit hub is a contemporary architectural marvel in Lower Manhattan and features a Sky Reflector Net centerpiece…</p>
</a>
</p>
<p>
<a class="">
<h2>
<span class="">2</span>
NUM 2
</h2>
<h3>200 Broadway</h3>
<p>This transit hub is a contemporary architectural marvel in Lower Manhattan and features a Sky Reflector Net centerpiece…</p>
</a>
</p>
<p>
<a class="">
<h2>
<span class="">3</span>
NUM 3
</h2>
<h3>200 Broadway</h3>
<p>This transit hub is a contemporary architectural marvel in Lower Manhattan and features a Sky Reflector Net centerpiece…</p>
</a>
</p>
<p>
<a class="">
<h2>
<span class="">4</span>
NUM 4
</h2>
<h3>200 Broadway</h3>
<p>This transit hub is a contemporary architectural marvel in Lower Manhattan and features a Sky Reflector Net centerpiece…</p>
</a>
</p>
<p>
<a class="">
<h2>
<span class="">5</span>
NUM 5
</h2>
<h3>200 Broadway</h3>
<p>This transit hub is a contemporary architectural marvel in Lower Manhattan and features a Sky Reflector Net centerpiece…</p>
</a>
</p>
<p>
<a class="">
<h2>
<span class="">6</span>
NUM 6
</h2>
<h3>200 Broadway</h3>
<p>This transit hub is a contemporary architectural marvel in Lower Manhattan and features a Sky Reflector Net centerpiece…</p>
</a>
</p>
</div>
<!--columns-->
<div class="arrows">
<span class="LeftArrow"> Previose </span> <span class="RightArrow"> Next </span>
</div>
https://jsfiddle.net/n5qh89vw/
The reason I want it to work this way is I have straight output from a DB into a list of <div> s and I would like to avoid having to make it more complicated and have to have the output count the number of data items then form the markup into inline divs or tables (as in x number cells will make y columns with rows of 4) as I want to keep this as simple as possible.
Is there a way to get this to work with IE?
According to Can I Use, Multiple column layout is supported in IE 10+. If you need to support older versions of IE there is a CSS multicolumn polyfill (found in the Resources tab at Can I Use).
Now that you've updated your question to specify that you need this for IE9, here is a full example using Adam Wulf's Columnizer jQuery Plugin:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="/path-to-local-file/jquery.columnizer.min.js"></script>
<script>
$(function(){
$('.wide').columnize({width:400});
$('.thin').columnize({width:200});
});
</script>
<style>
.column p, .column h1{ padding: 5px; }
body { font-size: 9pt; }
#wrapper { margin: 0px 100px; }
.wide, .thin { clear:both; }
</style>
</head>
<body>
<div id="wrapper">
<div class="wide">
<h1>Lorem ipsum ne justo</h1>
<p>Bonorum has. His ut cibo quas tantas, vis ut probo adhuc definiebas, has at meis debet vulputate. No sed velit essent suavitate, in pro decore ceteros temporibus, usu in odio offendit theophrastus. Mel labore indoctum cu, ad soleat admodum delicatissimi sed, mei viris tritani ullamcorper eu. Ut vim simul aperiam.</p>
<p>Eu eleifend repudiandae has. Mea eu ridens aliquam. Nisl aeque sit ut, posse dolor utinam cum in. Ad timeam sapientem eos, et eripuit inermis nam. Eos integre voluptaria ne, iriure concludaturque ut eum.</p>
<p>Vis erant intellegat in. Soleat legere no ius, usu ex laoreet molestie. Sit eu sint inermis. Ea zzril scribentur pro.</p>
<h1>Tempor essent appetere</h1>
<p>Ius mutat commune expetendis in. Nam et quas sensibus reprimique, vix no erat soluta suavitate. At mel eius dictas latine. Corrumpit inciderint reformidans sed no, no usu omnis utinam noluisse.</p>
<p>Sit et, an ius nihil apeirian. Eu posse tempor iuvaret cum. No diam dolor sea, postea mnesarchum ne ius, vel no utinam ignota dolores. Malis suscipit accusamus his ne, utinam assentior prodesset ea eam, facer partem antiopam et cum.</p>
<p>Probo debet quaestio an eos, no mel assum iracundia delicatissimi, rebum facete utroque sed ex. Eu melius invidunt repudiandae vix, eu paulo reformidans deterruisset duo, solum voluptaria efficiantur ea mel. Qui summo zzril alienum et. Eu est ferri iuvaret, mazim epicurei sententiae ut cum, modo reque intellegat ex vix. Vim eu tibique accusamus, quot electram at qui.</p>
<p>Ex iisque eleifend periculis has. Sit aeterno virtute partiendo ei, eam nonumy bonorum adolescens ad. Ut nec suas vocent ornatus, cetero legendos constituam mea ea, pri cu delenit iracundia. Mundi decore nec te.</p>
<h1>Soleat civibus in pri</h1>
<p>In petentium erroribus percipitur per. Takimata accommodare ius ut, eam no postulant urbanitas. Qui ei tantas consectetuer, quis dictas euripidis duo ei. Quaeque democritum concludaturque has ne.</p>
<p>Blandit insolens constituto vix an. Has diam wisi in, eum unum repudiare no. Sit at virtute rationibus, qui vitae explicari cu. Vim ne singulis voluptatum, sed puto accusata salutandi ei. Ad mel civibus adversarium.</p>
<p>Per ne solum vivendo, fabulas dolorem vivendo in pro. Nec duis ignota cotidieque no, an per possit nostrum. Pro detraxit definitionem eu. Vivendo officiis no nam, eu has reque maiestatis percipitur, dolore reprimique accommodare cum ad. No utinam voluptua oportere pri, augue sonet dicant ei sea.</p>
<p>Sit et, an ius nihil apeirian. Eu posse tempor iuvaret cum. No diam dolor sea, postea mnesarchum ne ius, vel no utinam ignota dolores. Malis suscipit accusamus his ne, utinam assentior prodesset ea eam, facer partem antiopam et cum.</p>
</div>
<div class="thin">
<h1>Lorem ipsum ne justo</h1>
<p>Bonorum has. His ut cibo quas tantas, vis ut probo adhuc definiebas, has at meis debet vulputate. No sed velit essent suavitate, in pro decore ceteros temporibus, usu in odio offendit theophrastus. Mel labore indoctum cu, ad soleat admodum delicatissimi sed, mei viris tritani ullamcorper eu. Ut vim simul aperiam.</p>
<p>Blandit insolens constituto vix an. Has diam wisi in, eum unum repudiare no. Sit at virtute rationibus, qui vitae explicari cu. Vim ne singulis voluptatum, sed puto accusata salutandi ei. Ad mel civibus adversarium.</p>
<p>Ius mutat commune expetendis in. Nam et quas sensibus reprimique, vix no erat soluta suavitate. At mel eius dictas latine. Corrumpit inciderint reformidans sed no, no usu omnis utinam noluisse.</p>
<p>Probo debet quaestio an eos, no mel assum iracundia delicatissimi, rebum facete utroque sed ex. Eu melius invidunt repudiandae vix, eu paulo reformidans deterruisset duo, solum voluptaria efficiantur ea mel. Qui summo zzril alienum et. Eu est ferri iuvaret, mazim epicurei sententiae ut cum, modo reque intellegat ex vix. Vim eu tibique accusamus, quot electram at qui.</p>
<p>Eu eleifend repudiandae has. Mea eu ridens aliquam. Nisl aeque sit ut, posse dolor utinam cum in. Ad timeam sapientem eos, et eripuit inermis nam. Eos integre voluptaria ne, iriure concludaturque ut eum.</p>
<p>Sit et, an ius nihil apeirian. Eu posse tempor iuvaret cum. No diam dolor sea, postea mnesarchum ne ius, vel no utinam ignota dolores. Malis suscipit accusamus his ne, utinam assentior prodesset ea eam, facer partem antiopam et cum.</p>
<p>Vis erant intellegat in. Soleat legere no ius, usu ex laoreet molestie. Sit eu sint inermis. Ea zzril scribentur pro.</p>
<h1>Tempor essent appetere</h1>
<p>Ius mutat commune expetendis in. Nam et quas sensibus reprimique, vix no erat soluta suavitate. At mel eius dictas latine. Corrumpit inciderint reformidans sed no, no usu omnis utinam noluisse.</p>
<p>Sit et, an ius nihil apeirian. Eu posse tempor iuvaret cum. No diam dolor sea, postea mnesarchum ne ius, vel no utinam ignota dolores. Malis suscipit accusamus his ne, utinam assentior prodesset ea eam, facer partem antiopam et cum.</p>
<p>Blandit insolens constituto vix an. Has diam wisi in, eum unum repudiare no. Sit at virtute rationibus, qui vitae explicari cu. Vim ne singulis voluptatum, sed puto accusata salutandi ei. Ad mel civibus adversarium.</p>
<p>Per ne solum vivendo, fabulas dolorem vivendo in pro. Nec duis ignota cotidieque no, an per possit nostrum. Pro detraxit definitionem eu. Vivendo officiis no nam, eu has reque maiestatis percipitur, dolore reprimique accommodare cum ad. No utinam voluptua oportere pri, augue sonet dicant ei sea.</p>
<p>Probo debet quaestio an eos, no mel assum iracundia delicatissimi, rebum facete utroque sed ex. Eu melius invidunt repudiandae vix, eu paulo reformidans deterruisset duo, solum voluptaria efficiantur ea mel. Qui summo zzril alienum et. Eu est ferri iuvaret, mazim epicurei sententiae ut cum, modo reque intellegat ex vix. Vim eu tibique accusamus, quot electram at qui.</p>
<p>Ex iisque eleifend periculis has. Sit aeterno virtute partiendo ei, eam nonumy bonorum adolescens ad. Ut nec suas vocent ornatus, cetero legendos constituam mea ea, pri cu delenit iracundia. Mundi decore nec te.</p>
<h1>Soleat civibus in pri</h1>
<p>In petentium erroribus percipitur per. Takimata accommodare ius ut, eam no postulant urbanitas. Qui ei tantas consectetuer, quis dictas euripidis duo ei. Quaeque democritum concludaturque has ne.</p>
<p>Blandit insolens constituto vix an. Has diam wisi in, eum unum repudiare no. Sit at virtute rationibus, qui vitae explicari cu. Vim ne singulis voluptatum, sed puto accusata salutandi ei. Ad mel civibus adversarium.</p>
<p>Ius mutat commune expetendis in. Nam et quas sensibus reprimique, vix no erat soluta suavitate. At mel eius dictas latine. Corrumpit inciderint reformidans sed no, no usu omnis utinam noluisse.</p>
<p>Sit et, an ius nihil apeirian. Eu posse tempor iuvaret cum. No diam dolor sea, postea mnesarchum ne ius, vel no utinam ignota dolores. Malis suscipit accusamus his ne, utinam assentior prodesset ea eam, facer partem antiopam et cum.</p>
<p>Per ne solum vivendo, fabulas dolorem vivendo in pro. Nec duis ignota cotidieque no, an per possit nostrum. Pro detraxit definitionem eu. Vivendo officiis no nam, eu has reque maiestatis percipitur, dolore reprimique accommodare cum ad. No utinam voluptua oportere pri, augue sonet dicant ei sea.</p>
<p>Sit et, an ius nihil apeirian. Eu posse tempor iuvaret cum. No diam dolor sea, postea mnesarchum ne ius, vel no utinam ignota dolores. Malis suscipit accusamus his ne, utinam assentior prodesset ea eam, facer partem antiopam et cum.</p>
</div>
</div>
</body>
You'll need to download that file since there's no CDN for it so don't forget to change path-to-local-file to the actual location of the file.
For others who only need to support 10+, the problem here is that you're only using the vendor-prefix versions of the CSS. You need to include the normal version as well:
-webkit-column-fill: auto;
-webkit-column-width: 300px;
-webkit-column-gap: 40px;
-moz-column-fill: auto;
-moz-column-width: 300px;
-moz-column-gap: 40px;
column-fill: auto;
column-width: 300px;
column-gap: 40px;
This worked for me in IE11:
$(document).ready(function() {
$(".RightArrow ").click(function() {
$(".columns").animate({
scrollLeft: '+=500'
}, 100);
});
$(".LeftArrow ").click(function() {
$(".columns").animate({
scrollLeft: '-=500'
}, 100);
});
}); //end script
body {
font-family: arial;
}
.columns {
overflow: hidden;
width: 500px;
border: 1px solid #000;
-webkit-column-fill: auto;
-webkit-column-width: 300px;
-webkit-column-gap: 40px;
-moz-column-fill: auto;
-moz-column-width: 300px;
-moz-column-gap: 40px;
column-fill: auto;
column-width: 300px;
column-gap: 40px;
padding: 0 20px;
text-align: left;
height: 500px;
overflow: hidden;
position: relative;
}
.notsectable {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: -moz-none;
-o-user-select: none;
user-select: none;
}
.arrows {
width: 500px;
}
.RightArrow {
float: right;
cursor: pointer;
}
.LeftArrow {
float: left;
cursor: pointer;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="columns">
<p>
<a class="">
<h2>
<span class="">1</span>
NUM 1
</h2>
<h3>200 Broadway</h3>
<p>This transit hub is a contemporary architectural marvel in Lower Manhattan and features a Sky Reflector Net centerpiece…</p>
</a>
</p>
<p>
<a class="">
<h2>
<span class="">2</span>
NUM 2
</h2>
<h3>200 Broadway</h3>
<p>This transit hub is a contemporary architectural marvel in Lower Manhattan and features a Sky Reflector Net centerpiece…</p>
</a>
</p>
<p>
<a class="">
<h2>
<span class="">3</span>
NUM 3
</h2>
<h3>200 Broadway</h3>
<p>This transit hub is a contemporary architectural marvel in Lower Manhattan and features a Sky Reflector Net centerpiece…</p>
</a>
</p>
<p>
<a class="">
<h2>
<span class="">4</span>
NUM 4
</h2>
<h3>200 Broadway</h3>
<p>This transit hub is a contemporary architectural marvel in Lower Manhattan and features a Sky Reflector Net centerpiece…</p>
</a>
</p>
<p>
<a class="">
<h2>
<span class="">5</span>
NUM 5
</h2>
<h3>200 Broadway</h3>
<p>This transit hub is a contemporary architectural marvel in Lower Manhattan and features a Sky Reflector Net centerpiece…</p>
</a>
</p>
<p>
<a class="">
<h2>
<span class="">6</span>
NUM 6
</h2>
<h3>200 Broadway</h3>
<p>This transit hub is a contemporary architectural marvel in Lower Manhattan and features a Sky Reflector Net centerpiece…</p>
</a>
</p>
</div>
<!--columns-->
<div class="arrows">
<span class="LeftArrow"> Previose </span> <span class="RightArrow"> Next </span>
</div>
The answer is simple and is NO. If you don't want to put some logic in it and divide the results into specific DIVs then you won't be able to get the desired result. sorry :(
I would like to create a responsive layout, where inner divs have padding, own background color, and colored border.
The space between inner divs and the space between inner divs and the frame of the container div should be equal.
I can solve this with three layers of divs: container, container of inner divs, inner divs.
.container {
box-sizing: border-box;
padding-top: 1.5em;
padding-left: 1.5em;
}
.containers {
float: left;
width: 50%;
box-sizing: border-box;
padding-bottom: 1.5em;
padding-right: 1.5em;
}
.item {
background: rgba(0, 0, 0, 0.1);
padding: 1.5em;
border: 0.5em solid rgba(0, 0, 0, 0.4);
}
jsfiddle demo
Could I achieve the same result without using an extra layer of divs? Should I maybe look into flexbox?
Could I achieve the same result without using an extra layer of divs?
Yes, but with little tricks. Make the paddings and margins in pixels instead of ems to allow for pixel prefect positioning. Also, you will need a little bit of calc for width to exclude extra margins and change margins on odd numbered divs to align them neatly. This will provide you with equal spacing between all divs and also between the parent.
Demo Snippet 1:
* { box-sizing: border-box; padding: 0; margin: 0; }
.container {
width: 80%; margin: 8px auto; padding: 16px 16px 0px 16px;
background-color: pink; overflow: hidden;
}
.item {
width: calc(50% - 8px); float: left; padding: 16px;
margin-bottom: 16px;
background: rgba(0, 0, 0, 0.1);
border: 8px solid rgba(0, 0, 0, 0.4);
}
.container > div:nth-child(odd) { margin-right: 16px; }
#media screen and (max-width: 520px) {
.item { width: 100%; }
}
<div class='container'>
<div class='item'>
Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo.
</div>
<div class='item'>
Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo.
</div>
<div class='item'>
Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo.
</div>
<div class='item'>
Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo.
</div>
<div class='item'>
Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo.
</div>
<div class='item'>
Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo.
</div>
</div>
Demo Fiddle 1: http://jsfiddle.net/abhitalks/76swyuLf/
Should I maybe look into flexbox?
Yes. A flex layout will make it easier for you. The trick here would be to use justify-content: space-around; to allow for equal space in-between the divs and also around them inside the container.
Demo Snippet 2:
* { box-sizing: border-box; padding: 0; margin: 0; }
.container {
width: 80%; margin: 8px auto; padding: 0.5em; background-color: pink;
display: flex; flex-direction: row; flex-wrap: wrap;
justify-content: space-around;
}
.item {
flex: 1 1 40%;
padding: 1.5em; margin: 0.5em;
background: rgba(0, 0, 0, 0.1);
border: 0.5em solid rgba(0, 0, 0, 0.4);
}
#media screen and (max-width: 520px) {
.item { flex-basis: 100%; }
}
<div class='container'>
<div class='item'>
Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo.
</div>
<div class='item'>
Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo.
</div>
<div class='item'>
Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo.
</div>
<div class='item'>
Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo.
</div>
<div class='item'>
Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo.
</div>
<div class='item'>
Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo.
</div>
</div>
Demo Fiddle 2: http://jsfiddle.net/abhitalks/8end4o6d/
What about using margin to space the items? You can still use your inner padding and borders. I added a clearfix to your container as well.
http://codepen.io/anon/pen/zvbKdZ
*{
box-sizing: border-box;
}
body {
background: pink;
}
.container {
padding-top: 1.5em;
padding-left: 1.5em;
}
.container:before, .container:after{
clear: both;
content: "";
display: table;
}
.item {
float: left;
width: 48.5%;
margin-right: 1.5%;
margin-bottom: 1.5%;
background: rgba(0, 0, 0, 0.1);
padding: 1.5em;
border: 0.5em solid rgba(0, 0, 0, 0.4);
}
#media screen and (max-width: 600px) {
.containers {
width: 100%;
}
}
Yes, it is possible. Check this(.containers are removed)
Jsfiddle
body {
background: pink;
}
.item {
float: left;
box-sizing: border-box;
background: rgba(0, 0, 0, 0.1);
padding: 1.5em;
margin: 1.5em;
border: 0.5em solid rgba(0, 0, 0, 0.4);
width: calc(50% - 4em);
}
#media screen and (max-width: 600px) {
.item {
width: calc(100% - 4em);
margin-bottom: 0;
}
.item:last-child {
margin-bottom: 1.5em;
}
}
<div class="containers">
<div class="item">Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo. Viderer voluptatibus an eam, possim commune eum ut, te animal suavitate
complectitur sed. Numquam veritus delicata duo ea, vix ad dicta meliore.</div>
<div class="item">Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo. Viderer voluptatibus an eam, possim commune eum ut, te animal suavitate
complectitur sed. Numquam veritus delicata duo ea, vix ad dicta meliore.</div>
<div class="item">Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo. Viderer voluptatibus an eam, possim commune eum ut, te animal suavitate
complectitur sed. Numquam veritus delicata duo ea, vix ad dicta meliore.</div>
<div class="item">Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo. Viderer voluptatibus an eam, possim commune eum ut, te animal suavitate
complectitur sed. Numquam veritus delicata duo ea, vix ad dicta meliore.</div>
<div class="item">Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo. Viderer voluptatibus an eam, possim commune eum ut, te animal suavitate
complectitur sed. Numquam veritus delicata duo ea, vix ad dicta meliore.</div>
<div class="item">Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo. Viderer voluptatibus an eam, possim commune eum ut, te animal suavitate
complectitur sed. Numquam veritus delicata duo ea, vix ad dicta meliore.</div>
<div class="item">Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo. Viderer voluptatibus an eam, possim commune eum ut, te animal suavitate
complectitur sed. Numquam veritus delicata duo ea, vix ad dicta meliore.</div>
</div>
You would be great to find this solution.
Cool!
body {
background: pink;
margin: 0px;
padding: 0px;
}
.containers {
float: left;
width: 100%;
box-sizing: border-box;
padding: 1.5em 1.5em 0;
}
.item {
float: left;
box-sizing: border-box;
background: rgba(0, 0, 0, 0.1);
padding: 1.5em;
margin-bottom: 1.5em;
border: 0.5em solid rgba(0, 0, 0, 0.4);
}
<div class="containers">
<div class="item">Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo. Viderer voluptatibus an eam, possim commune eum ut, te animal suavitate complectitur sed. Numquam veritus delicata duo ea, vix ad dicta meliore.</div>
<div class="item">Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo. Viderer voluptatibus an eam, possim commune eum ut, te animal suavitate complectitur sed. Numquam veritus delicata duo ea, vix ad dicta meliore.</div>
<div class="item">Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo. Viderer voluptatibus an eam, possim commune eum ut, te animal suavitate complectitur sed. Numquam veritus delicata duo ea, vix ad dicta meliore.</div>
<div class="item">Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo. Viderer voluptatibus an eam, possim commune eum ut, te animal suavitate complectitur sed. Numquam veritus delicata duo ea, vix ad dicta meliore.</div>
<div class="item">Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo. Viderer voluptatibus an eam, possim commune eum ut, te animal suavitate complectitur sed. Numquam veritus delicata duo ea, vix ad dicta meliore.</div>
<div class="item">Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo. Viderer voluptatibus an eam, possim commune eum ut, te animal suavitate complectitur sed. Numquam veritus delicata duo ea, vix ad dicta meliore.</div>
<div class="item">Lorem ipsum dolor sit amet, eam labores nusquam periculis et, sed ancillae salutatus te, an alia unum decore vim. Quas timeam aeterno ex sea, tale solum usu id. Eu impetus officiis quo. Viderer voluptatibus an eam, possim commune eum ut, te animal suavitate complectitur sed. Numquam veritus delicata duo ea, vix ad dicta meliore.</div>
</div>
Click here to find the working jsfiddle
I have been struggling with placing a YouTube video within a responsive CSS column with other content. I have used the recommended fix for responsive video scaling from CSS Tricks and other places. It works fine in Firefox, but the video disappears in Chrome and Safari. I have also tried using http://fitvidsjs.com but without success. Does anyone know of a way to get videos to appear properly within a CSS column with other content? I have also tried to work with other embedded non-video content (Issuu.com publications) and had the same problem.
Here is the CSS and HTML:
#content {
margin-left: auto;
margin-right: auto;
width: 100%;
overflow: hidden;
*zoom: 1;
overflow: hidden;
position: relative;
}
#content .content-columns {
display: inline;
float: left;
margin-left: 5%;
margin-right: 5%;
width: 90%;
-moz-column-count: 3;
-webkit-column-count: 3;
column-count: 3;
-moz-column-rule: 1px solid #ECECFB;
-webkit-column-rule: 1px solid #ECECFB;
column-rule: 1px solid #ECECFB;
-moz-column-gap: 26px;
-webkit-column-gap: 26px;
column-gap: 26px;
}
.mod-embed-video{
position: relative;
padding-bottom: 56.25%;
padding-top: 35px;
height: 0;
overflow: hidden;
}
.mod-embed-video iframe, .mod-embed-video object, .mod-embed-video embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
<div id="content">
<div class="content-columns">
<p>Lorem ipsum dolor sit amet, quodsi salutandi at mel, dicam accusamus ut mel. Tation omittam singulis nec no. Ea mea ludus corpora efficiendi. Vel id nihil legendos pertinacia, prima vocibus ut usu. Omnis delicata ut sea, lorem philosophia ex eos, an elit accommodare quo.</p>
<p>Et vim vero assum error. Sumo tantas an sit, magna dicta an mel, ut wisi feugait consequat eum. An ius recteque dignissim assueverit. Ius homero populo expetenda te, an sit amet possit pertinacia. Sed aeterno perpetua ea. Eam cu ullum dicta, commodo appareat id pro.</p>
<p>Mea cu commodo aeterno labitur, ius dolorem intellegat disputando ea, cum eros harum no. Errem principes delicatissimi in vel. Evertitur forensibus eu sea, te has eirmod tractatos consetetur. Te has vitae mandamus suscipiantur, duo labores mentitum principes eu.</p>
<p>Ad elitr vocibus vim, agam oportere est et, his eu elit facilisi tacimates. Soleat torquatos deterruisset mel ut, in tollit ocurreret his, vis et nulla epicurei vituperata. Tation euismod accusam sea in, sed modo dico ut. Pri ignota putant iudicabit ex.</p>
<p>Et vim vero assum error. Sumo tantas an sit, magna dicta an mel, ut wisi feugait consequat eum. An ius recteque dignissim assueverit. Ius homero populo expetenda te, an sit amet possit pertinacia. Sed aeterno perpetua ea. Eam cu ullum dicta, commodo appareat id pro.</p>
<div class="mod-embed-video">
<iframe width="550" height="309" src="//www.youtube.com/embed/9-5MVFMWSh0?rel=0" frameborder="0" allowfullscreen></iframe>
</div>
<p>Et vim vero assum error. Sumo tantas an sit, magna dicta an mel, ut wisi feugait consequat eum. An ius recteque dignissim assueverit. Ius homero populo expetenda te, an sit amet possit pertinacia. Sed aeterno perpetua ea. Eam cu ullum dicta, commodo appareat id pro.</p>
</div>
</div>
because you use float:left and it breaks your responsive iframe approach because position is set to absolute, therefore you get nothing. You need to find another solution where either you use another approach for columns, probably using Jquery, because column-count won't work and quite honestly I can't think of any pure html5+css approach that will allow automatic columns + responsive video