What App Has Diffrent Colors and Art in Your Comment Box on Facebook

Welcome dorsum! In this part of the tutorial we're going to be coding our pattern into HTML and illustrating some of Facebook's CSS fashion properties that will give it that native feel. So stick with me, make yourself a loving cup of tea and happy coding!


Introduction

Welcome to part 2 of our design and code a native Facebook app. In the last article we looked behind the scenes at some of the idea processes involved with creating a native look and feel Facebook app. Although we didn't go into great item about the actual design of information technology in Photoshop; we did hash out how Facebook's design principles can help you with designing your app. For my example I chose to recreate the webdesigntuts+ weblog as a Facebook app. I'm presuming that you are all comfortable plenty in Photoshop to have either replicated it or tailored it to create your own native wait and feel design.

What Nosotros'll be Creating

Design and Code an Integrated Facebook App Design and Code an Integrated Facebook App Design and Code an Integrated Facebook App

In this role of the tutorial we're going to be coding that design into HTML and illustrating some of Facebook's CSS style properties that will requite it that native feel. So stick with me, brand yourself a loving cup of tea and happy coding!


Step 1: Failing to Ready is Preparing to Fail

It's always a good idea to begin with a bit of forward planning. Some of yous will desire to design your layout in Photoshop whilst some of you who are confident plenty volition want to bound straight from the wireframe into the HTML/CSS marking up. Personally I e'er like to create what I am going to be coding into Photoshop kickoff equally information technology gives me a strong visual thought as to what I am going to exist coding. It can as well come up in handy in the future for when you want to update your app. It can be much easier to accommodate and anticipate things in Photoshop than it can be in your code editor.

Sometimes I also similar to print out my wireframe and marking the dimensions on them with a pen. This too makes life easier when I'grand coding things up. Every bit you lot become along I'm sure you will come upwards with your ain methods and ways of doing things and a part of it is finding the best way that suits you.


Step 2: App Structure

Facebook app folder structure Facebook app folder structure Facebook app folder structure

The way I have my folder structured is as follows (and this is pretty much my standard way of setting things up for every project). You can save yourself a lot of time by simply creating this bare binder template on your hard drive and copying it every time y'all create a new project

  • css
  • js
  • images
  • index.html

Step 3: HTML Markup

Setting Up our Includes

For this project I've used the HTML5 doctype, which I think nigh of you lot should have tried out by at present. For my CSS reset I've linked to Yahoo's CSS reset from their YUI library. If you're not familiar with a CSS reset, in its well-nigh bones form information technology can be described as:

a stylesheet to reduce browser inconsistencies in things similar default line heights, margins and font sizes of headings etc

I'm not going to go into too much detail nearly this in this tutorial simply you can find more information regarding this in the farther reading department below.

After the reset I've then linked to my own CSS file which I've named 'fashion.css'. I've then followed this past the latest include of jQuery and an include to my ain javascript file which I have named 'myjava.js' (although we will be creating this file in the side by side office of the tutorial). This file will permit us to do our filter search and change the content of our page tabs

Setting Up Our Folio

Whilst creating the html version of our Facebook app I'd like to put everything in a wrapper that is 760px broad. This is simply to ensure that I'm staying within 760px; the width of the canvas that Facebook allows your app to sit down in. I so remove this wrapper and the CSS for it before I put it into Facebook.

In one case we've setup our includes and 'wrapper' it'due south and so fourth dimension to motion onto the main building blocks of our app. In this example it's relatively simple as we only take the 'maincontent' and the 'sidebar' divs. To this nosotros'll employ classes of the same name. You could, if you lot wanted, apply 'id's' instead of 'classes' every bit these div instances will not be repeated. Still, something, which I always opt for (although I'k certain some would disagree) is to utilize classes on most items. I rarely use id's. I discover that by doing this it just keeps it elementary for me. I never have to wonder whether I've given something an 'id' or a 'class'. This tin come in remarkably handy especially when you start to incorporate jQuery into your apps. Although exercise consider whether it is feasible before you start coding that yous definitely will not need to use id'southward anywhere.

Information technology'southward besides advisable to ever terminate your markup blocks with a endmost comment stating which part of the markup has finished. This fashion you know where each section ends. I must admit I was pretty late at adopting this technique and in hindsight I could take saved myself many hours of having to wade my way through heaps of code trying to find out where sure blocks begin and end.


Stride 4: Chief Content

Facebook app main content Facebook app main content Facebook app main content

For this app I didn't remember it was necessary to use a header just to business firm the logo so I've put this at the top of the 'maincontent' div in its own div with a class called 'logo'. This is then followed by an unordered list for the tabs. I've given the tabs a class name of; aye y'all guessed information technology 'tabs'. These will act as our tab menu bar that volition display the different pages of our weblog app.

The pages of our web log app are wrapped inside a div container, which I have given a class of 'tab_container'. Inside this I and so have 4 divs (one for each tab/page). I have given all four of these a class chosen 'tab_content' with each ane having its own class for its position within the page. The offset tab has an extra grade of 'tab1', the 2nd 'tab2', the 3rd 'tab3' etc. These individual course names will exist used to help us identify each tab in the next function of the tutorial when nosotros implement the jQuery.


Step 5: Individual Blog Posts

webdesigntuts Facebook app blog posts webdesigntuts Facebook app blog posts webdesigntuts Facebook app blog posts

The individual blog mail has a class titled "mail" and is situated in the div with the course 'tab1' as this tab will be on the default-landing page. This so contains several anchor and span tags which will allow u.s.a. to exist able to way items such as the appointment and blog author in the native blueish a la facebook. Once this 'mail service' div has been completed we can just re-create and paste it for the rest of the posts. Don't get overboard and clog upwards your lawmaking, proceed it to around iii or 4 as this volition requite u.s. an idea as to how it will look and feel. I've also created a span with the course 'line' which is only a horizontal line that nosotros volition use throughout the app.


Pace 6: Other Page Tabs

webdesigntuts Facebook app tabbed pages webdesigntuts Facebook app tabbed pages webdesigntuts Facebook app tabbed pages

Our other Page Tabs are made up mainly of h3, anchor and paragraph tags:


Step 7: The Search Filter

webdesigntuts Facebook app filter search webdesigntuts Facebook app filter search webdesigntuts Facebook app filter search

At the height of the sidebar we accept our site filter search - this is made upward from a elementary form. We will make this operational in the side by side function of the tutorial using jQuery. The form is and then followed past another horizontal line and a span and paragraph text to display our 'likes' count.


Step eight: Facebook Like and Button

Fortunately for united states of america, Facebook has made it super simple to contain a like button into our app. You can generate the code for your own like button or whatsoever of their other social plug-ins at Facebook Developer Plugins. Once you've generated the code, bring information technology into your html. You lot may want to add some CSS to position it, however in this case it isn't necessary


Stride 9: Tab Headers

If you take read the first part of this tutorial (if y'all've made it this far I'm guessing you have) then yous'll have heard me talking about reusability. These tab headers define that more than any other function of our code. As with Facebook nosotros are able to reuse these tab headers and implement them with keen ease. They come up in actually handy should yous want to add a quick additional section to the site.


Pace 10: The CSS

At present it'south time to motility onto the styling of our HTML. Due to Facebook's elementary styling there isn't too much CSS. I've cleaved information technology up into parts for you to have a look at. It's besides important to point out at this stage that Facebook tin can be annoying when it comes to testing and tweaking your CSS as it caches it, pregnant that when you upload a new version of your mode sheet it all the same renders the quondam one. Although non perfect; the workaround I used was to add '?version=1' at the end of the included stylesheet in the index file. Every fourth dimension you do an update to the CSS and upload you as well have to update the version number in the index file.


Footstep 11: Setup

We outset the CSS by creating the wrapper and a couple of classes that I e'er add to be able to float items left or right.


Step 12: Building Blocks

The building blocks for our main content are as follows:


Step thirteen: Typography

Probably 1 of the most of import CSS parts of our Facebook app. Get this wrong and information technology will spoil the native effect of your app. Have a await around Facebook and choose the most suitable font sizes for your requirements.


Step 14: Tabs


Stride fifteen: Buttons

webdesigntuts Facebook app buttons webdesigntuts Facebook app buttons webdesigntuts Facebook app buttons

Another integral role of the CSS for Facebook apps is the buttons. I'm certain you'll want to use a few of these around your apps. We've created these non using a push, merely instead an anchor tag with a bridge class inside it for the image.


Pace 16: Extra Components


Conclusion...

Then there we have it, we now have our Facebook app coded upward into HTML/CSS. I hope you enjoyed reading this role of the tutorial and that you lot now have a great understanding on how Facebook's styles can be translated into CSS. Past looking at and using a few of Facebook's CSS backdrop we really are able to understand how just a few lines of lawmaking in the correct places can give our app that native look and experience, which will sit comfortably within Facebook and adhere to Facebook'due south design principles.

In the side by side part of the tutorial we'll be learning how to implement this into Facebook to be a native blog app. We'll be doing this using YQL and the Facebook Graph API. I'll too be showing yous a few hints and tips for spicing up your app with some sweet jQuery goodness. So until the next part, happy coding peeps!


Further Links & Resource

  • Blueprint and Code An Integrated Facebook App - Theory
  • Eric Meyer's CSS reset
  • Facebook social plugins
  • Our Webdesigntuts+ app on Facebook
  • thompsonwassew.blogspot.com

    Source: https://webdesign.tutsplus.com/articles/design-and-code-an-integrated-facebook-app-html-css--webdesign-4378

    0 Response to "What App Has Diffrent Colors and Art in Your Comment Box on Facebook"

    Post a Comment

    Iklan Atas Artikel

    Iklan Tengah Artikel 1

    Iklan Tengah Artikel 2

    Iklan Bawah Artikel