Creating Footer using ZURB Foundation CSS Framework - zurb-foundation

I am using ZURB foundation CSS framework to design a website. Currently I am trying to create a footer that will stay at the bottom of my page. I have the following code for the footer but its not going to the bottom, rather its showing up in the middle.
Could you please tell me how to create a footer (using ZURB foundation framework) that will stay at the bottom?
<div class="row">
<div class="twelve columns" style="background-color:#000000; height:30px; bottom:0;"></div>
</div>

Simple! Zurb Foundation is itself based on Compass. So you can use the 'Compass Sticky Footer' mixin.
http://compass-style.org/reference/compass/layout/sticky_footer/
There is an example of how to do it here:
http://compass-style.org/examples/compass/layout/sticky-footer/
But you just go:
<div class='example'>
<div id='layout'>
<div id='header'>
<h1>Sticky Footer Example</h1>
</div>
<p>
This is the main content area.
</p>
<p>
In this example you should pretend that the red box
is actually the browser window.
</p>
<p>
Because, being a contrived example, it's not actually sticking
to the bottom of the page.
</p>
<div id='layout_footer'></div>
</div>
<div id='footer'>
This is the footer area.
</div>
</div>
And in you SCSS
#import "compass/reset.scss";
#import "compass/layout.scss";
#include sticky-footer(72px, "#layout", "#layout_footer", "#footer");
#header {
background: #999999;
height: 72px; }
#footer {
background: #cccccc; }
.example {
height: 500px;
border: 3px solid red;
p {
margin: 1em 0.5em; } }

I would create two different footers - one for desktop & tablets - and one for phones.
Using Zurb's "show on and hide on options" it's very easy to do. You can have any graphics used by both footers so any "download penalty" is small.
To create a sticky footer for you website you'll have to add some CSS to Zurb. (You can add this to the app.css file, which is Zurb's repository for your extra CSS)
Also the Brad Frost article (posted by Ed Charbeneau) is a great read - I hadn't seen that before.

HTML:
<div id="footer">
My Awsome Footer 2014
</div>
CSS
#footer{
height: 50px;
position: fixed;
bottom: 0px;
left: 0px;
line-height: 50px;
color: #aaa;
text-align: center;
width: 100%;
}
working fiddle: http://jsfiddle.net/AunmM/

Check out this simple sticky footer for foundation, no need for a #wrapper or a fixed height! Works in mobile as well. http://tangerineindustries.com/download/sticky_footer/

For reference, here's how I accomplished this using Foundation 4.0.
Given a <footer> tag.
footer {
#include panel($panel-color, $panel-padding);
width: 100%;
margin: 0;
position: fixed;
bottom: 0;
}

With foundation 6 the compass import isn't possible out of box. And workaround is hard to find.
Good solution together with foundation can be this little helper:
http://tangerineindustries.com/download/sticky_footer/
Pro:
Developer created this for using together with ZF 6.
You only need a <footer> tag.
Works with responsive depending flexible height of footer, even with
window resizing.
You don't need any extra #wrapper, #pusher, #footer whatever
html-elements.
You don't need any extra CSS.
Contra:
Uses JavaScript.

What you are trying to do is create a "Sticky Footer" or "Fixed Position Footer". This is something which is independent of Foundation and instead is a function of CSS in general.
I would suggest reading this article by Brad Frost. It identifies the basic CSS involved in creating a Fixed Position element and the compatibility issues that arise from doing so.
http://bradfrostweb.com/blog/mobile/fixed-position/

Related

css transition on mouseout appears delayed

I'm trying to add transitions to a list of items where mouse over causes the item to expand by changing max-height.
The expand on mouse enter happens immediately but the mouse out transition is delayed.
jsfiddle https://jsfiddle.net/cawkie/u2eLh18f/2/
<html>
<head>
<style>
.inner {
border: solid 1px #000000;
width: 300px;
max-height: 30px;
overflow: hidden;
transition: max-height 10s linear 0s;
}
.inner:hover {
max-height: 10000px;
}
</style>
</head>
<body>
<div class="outer">
<div class="inner">
Lorem ipsum dolor ....
</div>
<div class="inner">
Lorem ipsum dolor ...
</div>
</div>
</body>
</html>
Possibly not relevant, but the JS mouse-out event is immediate.
Am I missing something?
Is there a workaround?
If this is normal/intended - why?
I could use JS/jQuery but was trying not to :-)
If your not opposed to using Bootstrap, they have a really nice accordion implementation you could use the achieve this effect without writing your own Javascript. If you do want to implement it yourself, you can add their CDN link to your page, then use Chrome DevTools to inspect the CSS in the Sources tab. Just prettify it and Ctrl+F search for the relevant classes.

Zurb foundation 6.4.3 6.4 topbar menu classes expanded menu-centered not working

For testing, I cloned a site that I built with Foundation 6.3.1 to another folder where I have 6.4.3 installed. Everything seems to display properly, I'm using the float mode.
Anyway, in 6.3.1 I used a couple of classes to style my topbar: expanded and menu-centered.
I was reading in the docs, from what I understand, you have to include #menu-expand; and #menu-align;.
Anyway, I tried this and 6.4.3 still just blows out my topbar.
I've posted 2 links here, both have the same HTML and CSS code for comparison.
See this version first - be sure to shrink your browser until you see the mobile menu and click it as well.
 Foundation 6.3.1 Version on CodePen  (works fine)
<!-- html -->
<div class="row top-row-wrapper">
<div class="top-bar menu-centered"> <!-- menu-centered -->
<div class="title-bar" data-responsive-toggle="my-menu" data-hide-for="medium">
<button class="menu-icon center" type="button" data-toggle="my-menu" data-responsive-toggle="my-menu"></button>
<div class="title-bar-title menu-left">MENU</div>
</div>
</div>
<div class="top-bar" id="my-menu">
<div class="top-bar-right">
<ul class="menu expanded menu-centered" data-responsive-menu="drilldown medium-dropdown">
<li><a class="home-link" href="/">HOME</a></li>
<li>SIRES</li>
<li>DONORS</li>
<li>BULLS</li>
<li>HEIFERS</li>
<li>BULL CARE</li>
<li>CONTACT</li>
</ul>
</div>
</div>
</div>
/*SCSS*/
$menu-margin: 0rem;
$menu-margin-nested: 1rem;
$menu-item-padding: 1rem;
$menu-icon-spacing: 1.25rem;
$topbar-padding: 0;
$topbar-title-spacing: 0rem 1rem 0rem 0;
$topbar-input-width: 200px;
$topbar-unstack-breakpoint: medium;
.top-bar ul.menu li {
padding-left:.5em;
padding-right:.5em;
}
.top-bar ul.menu li a {
border:1px solid blue;
}
.top-bar-right ul.menu li {
white-space:nowrap;
}
Foundation 6.4.3 Version on CodePen (same code, but notice expanded and menu-centered fail to work and the mobile menu goes bonkers). How to make the 6.4.3 version functional like the 6.3.1 version?
On a side note: I love testing out little snippets on Codepen, however, I can't figure out if it is possible to add / modify the app.scss that it uses in order to add do things like comment out includes (such as foundation-flex-grid / or add includes such as #include menu-expand;.

Rails Bootstrap Full Width Jumbotron

So, I'm using bootstrap with rails and I've put the correct code in from the bootstrap documentation, but that doesn't work. I've also put in code from other's projects and still my problem persists: I can't get my jumbotron to be full width (of the browser).
Here's what I've tried.
Overriding the width of .jumbotron to width: 100% !important;
Adding a row div followed by a column div with col-lg-12.
Changing the div .container to .container-fluid
I'm stuck. I'm wondering if it's a problem with the way I set up Bootstrap in my Rails app. I'm going to paste the code below. Any help is always appreciated. Thanks in advance, internet.
HTML:
<div class="jumbotron">
<div class="container">
<h1>Welcome to Sewingly</h1>
<p>A community marketplace for knitters, sewists, and other needle artists.</p>
</div>
</div>
CSS:
#import "bootstrap-sprockets";
#import "bootstrap";
html {
overflow-y: scroll;
}
body {
padding-top: 60px;
background-color: #fefefe;
}
.jumbotron {
background-image: url(http://i1216.photobucket.com/albums/dd370/kjames1581/jtronnew.jpg);
height: 250px;
color: white;
background-repeat: no-repeat;
background-size: cover;
border-radius: 0 !important;
font-weight: bold;
text-align: center;
margin-top: -9px;
p {
color: white;
}
}
js:
//= require jquery
//= require jquery_ujs
//= require bootstrap-sprockets
//= require turbolinks
//= require_tree .
and the gemfile:
gem 'bootstrap-sass', '~> 3.3.0'
gem 'sass-rails', '>= 3.2'
EDIT: Problem solved. The answer lies in the HTML output that you can get through inspecting the element. There was an extra container div bc I had wrapped all of my yielded content in the application html in a div labeled container as per Michael Hartl's tutorial. I removed that div and problem solved.
.container-fluid should work. Did you make other changes when you tried it? Here's a working example:
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
<div class="jumbotron">
<div class="container-fluid">
<h1>Welcome to Sewingly</h1>
<p>A community marketplace for knitters, sewists, and other needle artists.</p>
</div>
</div>

Pass a multiline text block as MediaWiki template parameter

I wish to make a collapse template to hide a block of text and show it by clicking on expand.
I found such code as follows
<div class="mw-collapsible mw-collapsed" style="background-color: #E6E6E6; border-style: thin black; font-style:italic; ">
<p><i>Try it by yourself before expanding on the right!</i></p>
<div class="mw-collapsible-content">
some text or wiki encoded text content (better for formatings and images)
that will remain hidden
until expand is clicked
</div>
</div>
which I tried to make a template for (Collapse)
<div class="mw-collapsible mw-collapsed" style="background-color: #E6E6E6; border-style: thin black; font-style:italic; ">
<p><i>Try it by yourself before expanding on the right!</i></p>
<div class="mw-collapsible-content">
{{{1}}}
</div>
</div>
My currently failing call would be
{{Collapse|some text or wiki encoded text content (better for formatings and images)
that will remain hidden
until expand is clicked}}
but I do not succeed to pass the input text block using {{{1}}} because my content is full of line feeds and other formatting tags.
Do I need to act in the template or in the call to wrap and with which tag?
any help welcome.
You need create two templates:
{{Collapse Begin}}
With contents:
<div class="mw-collapsible mw-collapsed" style="background-color: #E6E6E6; border-style: thin black; font-style:italic; ">
<p><i>Try it by yourself before expanding on the right!</i></p>
<div class="mw-collapsible-content">
And:
{{Collapse End}}
With contents:
</div>
</div>
And then on pages add:
{{Collapse Begin}}
some text or wiki encoded text content (better for formatings and images)
that will remain hidden
until expand is clicked
{{Collapse End}}
Apparently, naming the parameters allows using multiline input (do not ask me why!).
The following code does the job for me but thank you ankap for the smart idea, I will reuse it somewhere else.
I added an optional margin to indent the coloured box when used in lists and a separate parameters for the message shown in collapsed-mode.
<!-- takes tup to three parameters
* margin: to indent the block in the page, useful if the collapse is within a bullet list
* comment: to show a warning on the expand line
* content: the actual content to hide
# adding additional div improved support for lists etc...
-->
<div class="mw-collapsible mw-collapsed" style="background-color: #E6E6E6;
border-style: thin black; font-style:italic; margin-left: {{{margin|0px}}}; ">
<includeonly><i>{{{comment|<nowiki>
Try it by yourself before expanding on the right!</nowiki>}}}</i><includeonly>
<div class="mw-collapsible-content"><div>{{{content|{{{1}}}}}}</div></div>
</div>
enjoy!

Navigation with Centered Logo

I am using dynamic content (WordPress) and would like to center a logo in the middle of a list like: http://www.munto.net/queed-v1/.
I tested it out and my theory works, provided the number of items on both sides is the same...but if they're different it messes up the navigation.
You can see a live example at: http://joshrodgers.com/.
What I did was made my logo a background image and centered that to my unordered-list, then I set a width on each list-item (so that if there was a super-long one it wouldn't mess up the navigation), and finally after the third link I put a 200px margin on to the right of the list-item (that way there is no list-item over the logo)...but like I said this works perfectly if the number of items is even, if the items equal an odd number it looks funny.
Not sure what the best way to do this, so - what would be the best way to fix this?
Page Code:
<html>
<head>
<title>Josh Rodgers - El Paso, Texas</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<ul>
<li>Home</li>
<li>About Us</li>
<li class="example">super new lodge</li>
<li>Programs</li>
<li>Events</li>
<li>Contact Us</li>
<li>Contact Us</li>
</ul>
</body>
</html>
CSS Style:
/* Reset */
#import url("reset.css");
body {
margin: 0 auto;
position: relative;
width: 1000px;
}
ul {
background: #ff0000 url("images/example.jpg") top center no-repeat;
height: 200px;
margin: 0 auto;
text-align: center;
width: 1000px;
}
li {
background: #ffff00;
color: #ff0000;
display: inline-block;
font-size: 20px;
padding: 20px 0;
position: relative;
top: 70px;
width: 100px;
}
li.example {
margin-right: 200px;
}
*Figured I'd work on a normal php solution before integrating it into WordPress.
Thanks,
Josh
From a design point of view i would maybe consider making the logo the home link. A lot of web users are accustomed to clicking the logo and it taking them home. You could still incorporate the home text underneath the logo.
I would probably not use your method of margin-right: 200px to not cover the logo, anything you change before that list item will shift the margin.
Ultimately i would suggest rethinking having the logo set as a background-image and make it one of the list items.