33

I'm using foundation 3 to build a responsive website but I want to have the Footer and Navigation background width to occupy the entire width? I have named my rows as

class="row navigation"
class="row footer"

I tried looking for how to fix this but I'm out of options. I'm assuming it is a small fix in the foundation.css file but it's a bit too overwhelming at the moment as I'm new to it.

Any poiinters much appreciated.

Chou One
  • 627
  • 1
  • 13
  • 21

15 Answers15

67

I ran into the same problem yesterday. The trick is, for full width spanning blocks, you just keep them out of the row/column structure, since row/column will always apply the default padding. Keep your footers and headers on their own, and use row/column inside them.

<header>
    This will span the full width of the page
</header>
<div class="row">
    <div class="twelve columns">
        This text will flow within all typical padding and margins
    </div>
</div>
<footer>
    This will span the full width of the page
    <div class="row">
        <div class="twelve columns">
            This text will flow within all typical padding and margins
        </div>
    </div>
</footer>
nikolasleblanc
  • 1,157
  • 9
  • 11
  • I agree with this answer, but you can use any div to wrap. It doesn't have to be an html5 element such as footer. It just has to be completely outside of any nested grid structure. Often you will need to add margin and padding to make it "fit" visually with other elements on the page. I also created a [code pen to illustrate the above concept](http://codepen.io/jamesstoneco/pen/jErXyY). – JAMESSTONEco May 18 '15 at 02:33
66

What I have been doing is to add a custom class so that I can chain it with .row and override the max-width setting.

<div class="row full-width"></div>

.row.full-width {
  width: 100%;
  max-width: 100%; 
}

I put width in here too to cover bases, but it is already declared in foundation.css so you can just omit it.

James Chevalier
  • 10,604
  • 5
  • 48
  • 74
  • 1
    This is the method I use. I think its the simplest, and goes along with Foundation's semantic philosophy. – Logic Artist Jun 24 '13 at 16:31
  • This is also the route I took. If its a full width header or footer, I would just place the row inside the header/footer. If a full width row is a common occurrence though this is the best route to take. – alexbooots Aug 23 '13 at 18:42
  • Better answer for the expected behaviour – kheraud Aug 19 '15 at 19:41
12

If you're using Zurb Foundation Framework, simply remove the row class and wrap the element in a class container that is 100% width. Now you probably want to center the stuff, use class centered like this:

<div class="container navigation">
    <div class="centered">
        Some navigation stuff
    </div>
</div>
Iam Zesh
  • 1,797
  • 2
  • 20
  • 42
cosmicdot
  • 192
  • 1
  • 3
  • and what does class .centered ? you should add some more to your answer – Mark Sep 25 '12 at 07:19
  • .centered is built into Zurb foundation - there is a section in the documentation devoted to this, http://foundation.zurb.com/docs/grid.php There are a lot of quick positioning elements that are extremely useful. – cosmicdot Nov 20 '12 at 17:19
8

I completely disagree with the answer. You shouldn't have to use !important

Please refer to my article and demo at http://edcharbeneau.github.com/FoundationSinglePageRWD/

You should be able to get what you need from there. The demo is for 2.2 but is very similar in function to v3.

Ed Charbeneau
  • 4,501
  • 23
  • 23
5

Foundation 6 supports this feature naturally with row expanded. code example:

<div class="expanded row">
    ...
</div>

Read more here: http://foundation.zurb.com/sites/docs/grid.html#fluid-row

elicohenator
  • 747
  • 6
  • 17
4

Use "Section" as in:

<section>
  <div class="row">
   <div class="small-12 columns">
   </div>
  </div>
</section>

Then, assign an ID to the section and use that for your background.

Troy
  • 961
  • 6
  • 13
  • 24
3

This is in regards to Foundation 5. None of the answers given so far, provide edge-to-edge, full widths. That's because inner .columns add padding.

For a true edge-to-edge, full width content, add this to your CSS.

.row.full { width: 100%; max-width: 100%; }
.row.full>.column:first-child,
.row.full>.columns:first-child { padding-left: 0; }
.row.full>.column:last-child,
.row.full>.columns:last-child { padding-right: 0; }

Simply add .full class to a .row you wish to extend full width.

<div class="row full">
  <div class="medium-6 column">This column touches Left edge.</div>
  <div class="medium-6 column">This column touches Right edge.</div>
</div>
Timofey Drozhzhin
  • 4,416
  • 3
  • 28
  • 31
2

Just override the max-width property as max-width: initial;, for example,

    .fullWidth {
       width: 100%;
       margin-left: auto;
       margin-right: auto;
       max-width: initial;
    }

<div class="row fullWidth"> </div>

this works for me :)

Able Alias
  • 3,824
  • 11
  • 58
  • 87
2

I know that there are already many answers, but I think I have something new to add in this topic if someone is using Foundation 5 and stumbled upon this question (like me).

As Foundation is using REM units, it would be best to alter .row class using them and by adding extra class, so you can have only selected rows full-width. For example by using .full class:

.row.full {
    max-width: 80rem;  /* about 90rem should give you almost full screen width */
}

You can see that it is used like this even in documentation page of Zurb Foundation (they altered .row class, though): http://foundation.zurb.com/docs/ (just look into page source code)

wasil
  • 358
  • 2
  • 9
1

You really would want to keep the row class otherwise you lose a lot of the power of the grid system. Why not change the setting for $rowWidth from 1000 (default) to 100%. This can be found in the file foundation_and_overrides.scss

stephen
  • 11
  • 1
1

Just set the

$row-width: 100%;

http://foundation.zurb.com/forum/posts/927-full-width-layouts

Philip
  • 6,827
  • 13
  • 75
  • 104
0

I am not sure if I am missing something, but I had to add a .row div for the .centered to work. I can still style the .header to have a full width background in this case, but the .container method did not work for me.

<header class="header">
  <div class="row">
    <div class="centered">
       Logo and stuff
    </div>
  </div>

  <div class="row">
    Some navigation stuff   
  </div>
</header>
mamdouh alramadan
  • 8,349
  • 6
  • 36
  • 53
Jordan
  • 1,650
  • 2
  • 18
  • 17
0

If you don't give it the "row" class and put columns inside it works on a 100% width

David 天宇 Wong
  • 3,724
  • 4
  • 35
  • 47
-1

If you're using sass, this is a better way:

 <div class="row full-width"></div>

.row{
    &.full-width{ 
        width: 100%; 
        max-width: 100%!important; //might be needded depending on your settings
        &>.column:first-child,
        &>.columns:first-child{ 
            padding-left: 0; 
        }
        &>.column:last-child,
        &>.columns:last-child{ 
            padding-right: 0; 
        }
    }
}
Claudiu Creanga
  • 8,031
  • 10
  • 71
  • 110
-5

yes, just use like this:

  <div class="large-12 columns">

    <h2>Header Twelve Columns (this will have full width of the BROWSER <---->></h2>

  </div>

Chris
  • 67
  • 1
  • 7