Styling a Custom Facebook Tab

September 15th, 2010

Up until now, I was under the impression that you had to do all your styling inline when building a custom Facebook tab. Rejoice! Today I discovered there is another way to do the styling which is way less annoying.

Use the <style> Tag

To avoid using inline styles, you can insert a <style></style> at the top of your document. See below for an example:

Here’s what the code looks like

<style>
#mybox {
 background-color:#000;
 width:200px;
 height:200px;
}
</style>

<div id="mybox">This is my box</div>

Note how the <style> tag is not wrapped in a <head> tag. Also the code for your tab is not wrapped in a <body> tag. This is intentional, you need to leave those tags out for this to work. A little unorthodox but it gets the job done. Better yet, you don’t have to use those pesky inline styles!

Print This Post Print This Post

Theme Forest

Share this post

  • Twitter
  • Facebook
  • Delicious

One Comment on “Styling a Custom Facebook Tab”

Brent Lagerman

Saved me some time, thanks! :D

October 11, 2010 » 9:44 am

With free iPad 3 Surveys you will be able viewing email and editing documents just everywhere.