Foundation flex box stretch alignment with text vertically centered - zurb-foundation

I was doing the tutorial here: https://scotch.io/tutorials/get-to-know-the-flexbox-grid-in-foundation-6 and was trying the stretch here:
https://codepen.io/chrisoncode/pen/wMWEVE
<p class="text-center">Aligned Stretch (Columns are Equal Height)</p>
<div class="row align-stretch text-center">
<div class="columns">space</div>
<div class="columns">
<p>Look I'm a bunch of words. Spoiler alert for Star Wars: Jar Jar Binks is the new sith lord. He is Darth Darth Binks.</p>
</div>
</div>
body { padding-top:50px; }
.row { border:1px solid #FF556C; margin-bottom:20px; }
.columns { background:#048CB9; color:#FFF; padding:20px; }
.columns:first-child { background:#085A78;vertical-align:bottom }
.columns:last-child { background:#B3BBBB; }
On the 3rd example, using the stretch property, I am trying to get the text to vertically align middle and am having no luck. Can anyone tell me how to do it?
I tried adding .columns:first-child { background:#085A78;vertical-align:bottom } but that did not work.

HTML:
<p class="text-center">Aligned Stretch (Columns are Equal Height)</p>
<div class="row align-stretch text-center">
<div class="columns">
<div class="row align-center text-center"><p>space</p></div>
</div>
<div class="columns">
<p>Look I'm a bunch of words. Spoiler alert for Star Wars: Jar Jar Binks is the new sith lord. He is Darth Darth Binks.</p>
</div>
</div>
CSS:
div.row.align-stretch.text-center .columns {
display: flex;
justify-content: center;
align-items: center;
}
div.row.align-stretch.text-center .columns p {
margin: 0;
}

Flex children are equal height by default, unless you assign an align-items value other than stretch.
Therefor:
<div class="row align-stretch text-center">
Is the same as:
<div class="row text-center">
For your example, the simplest way is to use the .align-middle which will make the column the height of the content within and vertically center it to the taller column in the group.
Otherwise, you can make the column itself display: flex; and add align-items: center;

Related

Is there a way to have a top-bar with a header image that are sticky together at the top of the page?

I'm building a website for a friend's film production company using Foundation 6. I created a top-bar navigation bar with his logo image above the top-bar and made them both sticky. It seems to work fine on large screens and small screens but if viewed on anything in between the logo separates from the top-bar. This is most evident when you stretch and squish the page.
I've tried to include the image in the top-bar div but it aligns it to the left and I haven't been able to align it to the top as it is currently. This is the first time I've worked with the sticky function in Foundation. I've looked through the Foundation docs, Google, and StackOverflow but haven't found anything quite like this.
This is my top-bar section.
<div data-sticky-container>
<div class="title-bar" data-responsive-toggle="example-menu" data-hide-for="medium">
<button class="menu-icon" type="button" data-toggle="example-menu"></button>
<div class="title-bar-title">Menu</div>
</div>
<div class="grid-y">
<img src="images/safe_image.jpeg" style="width: 100%; height: auto"; data-sticky data-options="marginTop:0;">
<div class="top-bar" data-sticky data-options="marginTop:10.2;" style="width:100%; background-color: white; padding-top: 10px;" id="example-menu">
<!-- <div class="top-bar" style="width:100%; background-color: white; padding-top: 10px;" id="example-menu"> -->
<div class="top-bar-right" data-dropdown-menu style="display: table; margin: 0 auto;">
<ul class="dropdown vertical medium-horizontal menu" style="background-color: white;">
<li>Home</li>
<li>Current News</li>
<li>Film/Media</li>
<li>Photography</li>
<li>Publicity</li>
<li>Misc</li>
<li>Contact</li>
</ul>
</div>
</div>
</div>
I would like the logo image and the navigation bar to look the way they do at larger screen sizes but minimize together to the point where the data-toggle kicks in instead of separating, as they are doing currently.

how to trigger a button click event using javascript in iccube-reporting

i am using iccube reporting.
i have a button of type Actions/Buttons placed on a dashboard, and a pivot table.
the button fires an iccube event upon click, the event refresh the pivot table.
how can i trigger a button click programmaticly, using java script ?
this is the html snippet (generated by iccube)
<div class="ic3t-elegant ic3-fixed-layout-box ic3w-action ic3w-buttonlist **buttonRefreshCls** ic3h-no-header ic3-box-unselectable" id="ic3-9" style="top: 10px; left: 400px; width: 130px; height: 30px; z-index: 4;"><div class="ic3-loading-div-back"></div><div class="ic3-loading-div"></div><span class="ic3-stop-loading fa fa-stop" title="Stop Loading"></span> <div class="ic3-fixed-layout-menu-container"> <div class="ic3-fixed-layout-edit ic3-jui-app"></div> </div> <div class="ic3-inner"> <div class="ic3-box-header"> <div class="ic3-box-nav-menu" style="display: none;"></div> <div class="ic3-inner" style=""></div> </div> <div class="ic3-box-content" style="width: 130px; height: 30px;"> <div class="ic3-inner" style=""><div id="ic3-17" class="ic3-widget"><div class="ic3-action-list ic3-item-container ic3-item-horizontal ic3-bt-blue"><div class="ic3-item" style="" ic3-idx="0" title="">Manual Refresh</div><div style="clear:both"></div></div></div><div class="ic3-widget-data"></div></div> </div> </div> <div class="ic3-chart-filter-info"> </div></div>
as you can see there's no input button that you can trigger with js.
document.getElementsByClassName('buttonRefreshCls')[0].click();
thanks in advance, assaf

Zurb Foundation Margin between Columns

I have a very simple code with Foundation CSS
<div class="row">
<div class="large-offset-1 large-6 columns">Content goes here</div>
<div class="large-4 end columns">Side goes here</div>
</div>
I want there to be margins between the columns. Currently, there is only padding. So if I add background-color to these columns, then they stick to each other.
Doesn't Foundation provide a solution for this?
try this (it makes a full width div inside the other, automatically adding margins)
<div class="large-4 medium-6 small-12 columns">
<div class="large-24 columns">
... content ...
</div>
</div>
You could try this:
<div class="row">
<div class="large-offset-1 large-6 columns padded-column">
<div class="column-content">Content goes here.</div>
</div>
<div class="large-4 end columns padded-column">
<div class="column-content">Side goes here</div>
</div>
</div>
Then, for styles:
.padded-column {
padding: 10px;
}
.column-content {
background: red;
}
I had a similar issue that couldn't be resolved with padding. Since Foundation 5 isn't IE8 compatible, I just used calc eg. width: calc(50% - 10px);

Auto heighten divs in Foundation over using media queries?

My questions is a common problem i seem to encounter but my brain never registers the right answer for some reason, probably because i'm slow.
The question I have is regarding my navigation menu.
When i'm at full width in Foundation i use the large-12 class and the small-12 class for smaller viewports, however i have that nav div inside of another parent div so when i get to small viewport the navigation drops below the height of the parent div.
I've set the parent div to a min-height: 204px and a max-height: auto assuming that it will adjust in height to wrapping child elements but i doesn't work.
So what is the best way to ensure that child divs that grow in height due to smaller viewports will push the parent div in height as well?
Here is my html:
<div>
<div class="interior-header">
<div>
<nav class="utility">
<ul>
<li>Register</li>
<li>Login</li>
</ul>
</nav>
</div>
<div>
<nav class="main">
<div class="logo small-12 large-offset-1 large-5 columns left"></div>
<ul class="small-12 large-6 columns right">
<li>Home</li>
<li>Catalog</li>
<li>Learn More</li>
<li>Be a Broker</li>
<li>Contact</li>
</ul>
</nav>
</div>
</div>
</div>
and here is the css for this particular component:
// HEADER INTERIOR
.interior-header {
background: url('../img/hero.jpg');
background-size: cover;
background-repeat: no-repeat;
min-height: 174px;
max-height: auto;
}
// NAVIGATION FIRST TIER
nav.main {
margin-top: 2%;
min-height: 100px;
height: auto;
}
Any help would be awesome, thank you.
.main {overflow: hidden;}
This causes a block-level element to contain its descendants.

100% Height Problem

here's the site I'm working on: http://antidote.treethink.com/about/
I am trying to get it so that the footer is always at the bottom of the screen unless the content runs past the screen, then it will sit below the content.
To do this, I thought to have the "wrapper" div be 100% min-height then tell the footer to sit at the bottom of that div. I tried putting min-height classes on the body, html and wrapper tags but it didn't work.
This is my css: http://antidote.treethink.com/wp-content/themes/antidote-new/style.css
Thanks,
Wade
You can try classic solution
<div id="header-content">
<div id="header">
bar
</div>
<div id="content">
bar
</div>
</div>
<div id="footer">
foo
</div>
main.css
html,
body {
height:100%;
}
#header-content {
position:relative;
min-height:100%;
}
#content {
padding-bottom:3em;
}
#footer {
position:relative;
height:3em;
margin:-3em 0 0;
}
ie.css
* HTML #header-content {
height:100%; /* min-height for IE<7 */
}
This is just off the top of my head. My thought create a container div that holds your content. Put the footer at an relative position of bottom: 0px; within that.
<div id="content-container">
<div id="page-content" style="position: relative;"><p>This holds my content</p></div>
<div id="footer" style="position: relative; bottom: 0px;">
<p>Footer content in here</p>
</div>
</div>
I think that should work...
Edit
Actually the top of my head is not right. This post has helped me in the past though...
http://ryanfait.com/resources/footer-stick-to-bottom-of-page/