Conditional Stylesheets in FBML

FBML doesn’t allow the IE conditional stylesheet comments in Facebook Fan Pages.  In order get similar functionality, we need to leverage the significantly more powerful user-agent tags. This allows you to post user-agent conditional code to your fan page for any browser type.

#submit-container { margin-top: 15px; }
#agree-container { position: relative; top: 10px; }
#submit-button { padding: 9px 20px; border: 1px solid green; color: black; }

What isn’t clear in the FBML documentation at this point is how accurate the user-agent application is. If I’m spoofing my user-agent, does the effectiveness of this tag diminish? Most people don’t spoof their user agent, but there are people who do so. Presumably if the user agent is the only test, they wouldn’t be able to view your fan page.

1 Comment so far »

  1. Marshall said

    am September 28 2010 @ 8:46 pm

    This is incorrect.

    You can use the fb:user-agent tag to add conditionals for various browsers.

    Hi IE 6/7 users.

    Hi people not using Firefox.

    Hi Mozilla (but not Firefox 2.0) users.

    Hi IE (but not IE 6) users.

    See http://developers.facebook.com/docs/reference/fbml/user-agent for complete documentation.

Comment RSS · TrackBack URI

Leave a comment

Name: (Required)

eMail: (Required)

Website:

Comment: