Allowed FBML and HTML Tags

From Facebook Developer Wiki

Jump to: navigation, search

Facebook lets you utilize HTML and FBML throughout your applications, from the canvas page to various communication methods like Feed stories, email, and notifications.


Contents

Canvas Pages: Allowed Tags

  • a
  • abbr
  • acronym
  • address
  • b
  • bdo
  • big
  • blockquote
  • br
  • caption
  • center
  • cite
  • code
  • dd
  • del
  • dfn
  • div
  • dl
  • dt
  • em
  • fieldset
  • font
  • form
  • h1
  • h2
  • h3
  • h4
  • h5
  • h6
  • hr
  • i
  • img
  • input
  • ins
  • kbd
  • label
  • legend
  • li
  • link
  • meta
  • ol
  • optgroup
  • option
  • p
  • pre
  • q
  • s
  • samp
  • script
  • select
  • small
  • span
  • strike
  • strong
  • style
  • sub
  • sup
  • table
  • tbody
  • td
  • textarea
  • tfoot
  • th
  • thead
  • tr
  • tt
  • u
  • ul
  • var

Email: Allowed Tags

You can format your application email with the following HTML and FBML tags.

Block-level Elements

  • hr, address, div, h1, h2, h3, h4, h5, h6, p, blockquote, pre

Special Inline Elements

  • a, area, br, bdo, font, img, map, span

Table Elements

List Elements

  • dl, dd, dt, li, ol, ul

Style Elements

  • Head elements and attributes: link, meta, style, _style, _imgstyle, _class
  • Text elements: strong, em, b, big, i, ins, u, del, s

Form Elements

  • input, form, option, optgroup, select, textarea, label, fieldset, legend

Phrase Elements

  • abbr, acronym, cite, dfn, em, kbd, code, samp, strong, var

FBML Link Tags

FBML Image Tags

FBML Internationalization Tags

Disallowed Tags in Email

You cannot include the following tags in application email.

  • HTML tags: body, base, iframe, applet, bgsound, blink, char, colgroup, comment, dir, embed, frame, frameset, head, html, hx, ilayer, inlineinput, isindex, keygen, layer, listing, marquee, menu, multicol, nextid, nobr, noembed, noframes, nolayer, noscript, object, plaintext, param, rt, ruby, samp, sound, spacer, spell, wbr, xml, xmp
  • Script elements and attributes: script, script_onload, _clicktohide, _clicktoshow
  • Mock AJAX elements and attributes: _clickrewriteurl, _clickrewriteid, _clickrewriteform, flash_autoplay, fb:swf, fb:mp3, fb:flv

Feed Stories: Allowed Tags

Depending upon the size of the Feed story, you can include various HTML and FBML tags.

One line story templates can contain the following HTML and FBML tags: <a>, <b>, <small>, fb:name, fb:pronoun, fb:ref, and fb:if-multiple-actors.

Short story templates can contain the following HTML and FBML tags: <a>, <b>, <br> (template body only), <i>, fb:name, fb:pronoun, fb:ref, fb:if-multiple-actors, and, for calls to feed.publishUserAction, fb:publisher-link.

For short stories, rich media like images, Flash, MP3, and video are rendered in the template_data parameter when you call feed.publishUserAction, Facebook.showFeedDialog, or JS_API_M_FB.Connect.showFeedDialog.

Notifications: Allowed Tags

You can include only the following tags in your application notifications.

Boxes: Allowed Tags

Block-level Elements

  • hr, address, div, h1, h2, h3, h4, h5, h6, p, blockquote, pre

Special Inline Elements

  • a, area, br, bdo, font, img, map, span

Table Elements

List Elements

  • dl, dd, dt, li, ol, ul

Style Elements

  • Head elements and attributes: style, _style, _imgstyle, _class
  • Text elements: strong, em, b, big, i, ins, u, del, s

Form Elements

  • input, form, option, optgroup, select, textarea, label, fieldset, legend

Phrase Elements

  • abbr, acronym, cite, dfn, em, kbd, code, samp, strong, var

Script Elements and Attributes

  • script, script_onload, _clicktohide, _clicktoshow

Mock AJAX Elements and Attributes

  • _clickrewriteurl, _clickrewriteid, _clickrewriteform

Flash-related FBML Tags

User Interactivity Tags

FBML Visibility Tags:

FBML Internationalization Tags

Other FBML Tags

Disallowed Tags in Boxes

You cannot include the following elements in profile boxes.

HTML Tags

  • body, base, iframe, applet, bgsound, blink, char, colgroup, comment, dir, embed, frame, frameset, head, html, hx, ilayer, inlineinput, isindex, keygen, layer, link, listing, marquee, meta, menu, multicol, nextid, nobr, noembed, noframes, nolayer, noscript, object, plaintext, param, rt, ruby, samp, sound, spacer, spell, wbr, xml, xmp

FBML Tags

Script Elements and Attributes

  • script_onload

Mock AJAX Elements and Attributes

  • flash_autoplay
  • Relative URLs

Mobile Applications: Allowed Tags

You can format your mobile applications with the following HTML and FBML tags. You must wrap any mobile content (both XHTML and FBML) in fb:mobile tags.

Block-level Elements

  • hr, address, div, h1, h2, h3, h4, h5, h6, p, blockquote, pre

Special Inline Elements

  • a, br, bdo, img, span

Table Elements

List Elements

  • dl, dd, dt, li, ol, ul

Style Elements

  • Head elements and attributes: style, _style, _imgstyle, _class
  • Text elements: strong, em, b, big, i, ins, u, del, s

Form Elements

  • input, form, option, optgroup, select, textarea, label, fieldset, legend, fb:submit

Phrase Elements

  • abbr, acronym, cite, dfn, em, kbd, code, samp, strong, var

FBML Image Tags

FBML Link Tags

FBML Page Navigation Tags

Other FBML Tags

reference