Learning Foundations

I bought the book Jump start foundations from sitepoint and I am going through the lessons on there and I am having a few issues and have some questions.
I’m doing this from my own computer so the only was I can think of showing you is via screenshot.

1 - The first thing I’m stuck on is I have added a div to my row with the class of large-12 column and an unordered list within it with the class of small-block-grid-1 medium-block-grid-3. The autor says this should show them nicely side by side (see attachment 1) but all I’m getting is an unstyled list and I don’t know what I’m missing. I’m assuing foundations should already style these classes but not sure why mine is like it is so (see my result in attachment 2)

I’ve also attached a screenshot of my code and the code the book is telling me but I’m not sure if this is helpful or if you are able to know why it’s like it is for me? I’m not sure how else to show it?

2 - The second issue is the autor tell me to add an Icon bar to the footer. He says you can download the fonts from foundation and simply add them to the images folder however when I downloaded them they are a load of font and css files. I added the css files to my css folders and added a fonts file and added all the font files there and then added the links to them all in the header but unsurprisingly I get nothing? So what is the correct manner to add all these files etc for foundations?

Sorry for the long winded explations but I’m hoping you will know what i’m talking about but if not let me know what info I can add and how to make it clear.

Many thanks

1 Like

Hey, I’m the technical editor for that book…can you get this example up on codepen, or a live website?

I ran through it with my eyes, and I couldn’t spot any invalid HTML or anything which would lead to that (that’d be my first guess since it looks like some styling is missing there.

Great, thanks!

I added it here: http://www.muslimahwebdesign.co.uk/foundations

It appears your foundation file doesn’t have the block grid classes in there. Are you sure you downloaded Foundation that includes this? I know you can customize the Foundation build, so I’m wondering whether you did this, and if you left off block grid. Either way, it appears your foundation CSS file is incomplete.

I just went to the foundations site and downloaded the complete pacage and extracted it.

Also what about the footer?
I’ve added the markup for the footer. And downloaded the icon files and added them in the header. I’m sure I’ve done it wrong but in the book it says just to add them in the images file but that can’t be right either?

It appears block grids in Foundation 6 were merged into the main grid. When we wrote this book, Foundation 6 had not come out yet. It looks like the block grid CSS (the classes) are in foundation 5.x, but in 6 they were removed. Check out their documentation.

As far as the footer, I’m not seeing any HTML code referencing the footer. Revisit that chapter. What are the instructions? I don’t have the book in front of me. Looks like a step (or several) are missing.

So how would I get around this or do it to get the same results?

For the footer the book said to add this which is there:

<div class="icon-bar five-up"> <a class="item"> <i class="fi-mail"></i> </a> <a class="item"> <i class="fi-bookmark"></i> </a> <a class="item"> <i class="fi-social-tumblr"></i> </a> <a class="item"> <i class="fi-social-twitter"></i> </a> <a class="item"> <i class="fi-like"></i> </a> </div>

then it says this:

Within each of these item anchors we add the items themselves, which are simply blank elements with a class corresponding to the Foundation icon we’d like to use. These are font icons provided for free by Zurb. The advantage of using font icons is that they will look crisp in any display resolution. These icons can be found at Foundation’s website,2 and simply need to be downloaded and stored in the img folder of your root directory. By adding href=“” attributes to the anchor tags, we can direct these icons wherever we wish. Just like that, our footer has a beautiful icon bar with elegant (not to mention scalable) icons directing our users to various contact links.

But after going to foundation site and downloading the fonts they come is css and font files not images so I just added the files to the relevant folders and added the links in the header.

  1. Don’t include the font icons in the <link> tag. The font icons are not stylesheets. Remove all references to that in index.thml
  2. Got to your foundation.css file. Find this

@font-face {
  font-family: "foundation-icons";
  src: url("foundation-icons.eot");
  src: url("foundation-icons.eot?#iefix") format("embedded-opentype"),
       url("foundation-icons.woff") format("woff"),
       url("foundation-icons.ttf") format("truetype"),
       url("foundation-icons.svg#fontcustom") format("svg");
  font-weight: normal;
  font-style: normal;
}

That’s looking in the CSS folder for the font icons. Change the directory to look in the fonts folder so the CSS can actually make use of the font icons.

I can’t seem to find that there. Did you see this im my file or did you mean for me to add it?

Sorry, this CSS file

http://www.muslimahwebdesign.co.uk/foundations/css/foundation-icons.css

Those paths are pointing to /foundations/css/[icon font file name here].[extension]. That’s incorrect since they live in /foundations/fonts/[icon font file name here].[extension].

I see. I get it now.
So i did that but the images or none of the styling of the footer still don’t show up.

Because the path still isn’t correct :slight_smile: .

@font-face {
  font-family: "foundation-icons";
  src: url("fonts/foundation-icons.eot");
  src: url("fonts/foundation-icons.eot?#iefix") format("embedded-opentype"),
       url("fonts/foundation-icons.woff") format("woff"),
       url("fonts/foundation-icons.ttf") format("truetype"),
       url("fonts/foundation-icons.svg#fontcustom") format("svg");
  font-weight: normal;
  font-style: normal;
}

Your CSS file is here
http://www.muslimahwebdesign.co.uk/foundations/css/foundation-icons.css

That means you are looking in the CSS folder (as the base point), and it’s going to go …

http://www.muslimahwebdesign.co.uk/foundations/css/fonts/[font file name here].[extension]

That’s not the right path.

Change your code to this.

@font-face {
  font-family: "foundation-icons";
  src: url("../fonts/foundation-icons.eot");
  src: url("../fonts/foundation-icons.eot?#iefix") format("embedded-opentype"),
       url("../fonts/foundation-icons.woff") format("woff"),
       url("../fonts/foundation-icons.ttf") format("truetype"),
       url("../fonts/foundation-icons.svg#fontcustom") format("svg");
  font-weight: normal;
  font-style: normal;
}

Do you know how relative paths work, etc?

I see what you mean. I did it on my computer first and it didn’t work on there and uploaded it. I changed it to the proper URL but is that how it is supposed to be? In the book it looked like a grey footer with white icons.

Also I took a look at the new classes for blobk grids and I changed the block grod class but no change there either. Did I put the class in the wrong place or put it wrong?

The URL of your files will vary depending on how you decide to set up the folder structure. There is no “right” or “wrong” way :slight_smile: . [quote=“hantaah, post:14, topic:213518”]
Also I took a look at the new classes for blobk grids and I changed the block grod class but no change there either. Did I put the class in the wrong place or put it wrong?
[/quote]
You changed the classes but look at their HTML structure in their examples on the doucmentation site, and now look at yours.

Theirs:

<div class="row small-up-1 medium-up-2 large-up-4">
  <div class="column">
    <img src="//placehold.it/300x300" class="thumbnail" alt="">
  </div>
  <div class="column">
    <img src="//placehold.it/300x300" class="thumbnail" alt="">
  </div>
  <div class="column">
    <img src="//placehold.it/300x300" class="thumbnail" alt="">
  </div>
  <div class="column">
    <img src="//placehold.it/300x300" class="thumbnail" alt="">
  </div>
  <div class="column">
    <img src="//placehold.it/300x300" class="thumbnail" alt="">
  </div>
  <div class="column">
    <img src="//placehold.it/300x300" class="thumbnail" alt="">
  </div>
</div>

Yours

<div class="row">
  			<div class="large-12 columns">
  				<ul class="small-up-1 medium-up-3">
  					<li><h5>Day One</h5><img src="http://placehold.it/300x150"></li>
  					<li><h5>Day Two</h5><img src="http://placehold.it/300x150"></li>
  					<li><h5>Day Three</h5><img src="http://placehold.it/300x150"></li>
  				</ul>
  			</div>
  		</div>

Hint: There are “column” classes missing on certain list item elements.

oh right. The book says to do it as an ul so should I scrap that idea completely then and use their guide?

What should I do about the footer still? It’s still not styled like it is in the book? It has the font icons there but looks like there’s no styling for the icon-bar ?

sorry to be such a pain.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.