Industry guru Dave Taylor offers free tech support on a wide variety of technical and business topics, including HTML, Apple iPhone, online advertising, Cascading Style Sheets, Web design, management, Unix, Linux, search engine optimization, online dating, Mac OS X, shell script programming and Microsoft Windows.

What is BBCode and how do I use it?

Dave, I read your HTML primer for bloggers, but I'm confused because on the sites I add comments, I have to use something called bbcode, not HTML. What is bbcode and how do I use it?

Dave's Answer:

I haven't seen many weblogs that require BBCode, I have to say, but there are lots of discussion boards that require postings be written in BBCode rather than HTML. The main reason, as far as I can tell, is so there's some control over people not adding unauthorized HTML sequences (like including pictures from unaffiliated Web sites) because it doesn't seem that much easier than HTML when you look at the two.

Be that as it may, there are now a lot of different sites that are BBCode enabled, so let's have a look at how it works...

The basic difference between BBCode and HTML is that while HTML uses < and > to surround tags, BBCode requires that you use [ and ]. Once you realize that, it's pretty smooth sailing.

For example, bold text is produced with [b]text to have in bold[/b], while italics is generated with [i] and [/i] and underlining (which is still a bad idea on a Web page, even in BBCode) is done with [u] and [/u].

Font color and size changes are accomplished with deprecated HTML "font" tag attributes: [color=red]text in red[/color] turns some text red, for example. You can also specify the hexidecimal color equivalent if you're a purist (that is, use [color=#ccff00]), and text size can be specified as a value of 1..29, where [size=1]1=very small text[/size] and [size=29]29=really big text[/size]. The more modern way to specify these type attributes in the HTML world is to use CSS styles, but that's another story. :-)

A surprising number of boards that use BBCode also support special code listing blocks denoted with [code] and [/code]. Within these two tags, all < and > symbols are translated into their displayable equivalent (the HTML character entities &lt; and &gt;) so that you can share HTML code with other board members.

On sites that allow links to be created, there are two ways you can produce a hypertext reference in BBCode. The easiest is to tell the system that you're entering a Web site address -- a URL -- and that you want it clickable. To point to this Web site, for example, you'd use this: [url]http://www.askdavetaylor.com/[/url]. If you want to get a bit more fancy and have a few words that are clickable, then you need to separate the clickable words from the URL of the target site, as with regular HTML. To have the words "Dave Knows" link to this site, use this: [url=http://www.askdavetaylor.com/]Dave Knows[/url].

Finally, a small number of sites will let you include images using the [img] tag. It's completely analogous to the simpler of the URL forms shown earlier, and linking to, say, the cheery Yahoo Instant Messenger graphic on their home page can be accomplished with: [img]http://us.i1.yimg.com/us.yimg.com/i/ww/bt1/msg.gif[/img]. By the way, just because you can include a graphic doesn't mean you should or are allowed to...

That's about it for the BBCode language. You can combine multiple tags in a sequence if you want blue, bold, URLs, for example (you'd use [color=blue][b][url]the URL[/url][/b][/color]). Just make sure that you always close links from innermost to outermost, just like parentheses in your writing!

Hope that helps you figure out how to use BBCode to its fullest!



Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Stumble Upon    

Subscribe!

Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader.

Comments

but what about video from youtube?

Posted by: ariel at May 13, 2007 8:54 PM

Dear Dave,
The BBCODe for posting YouTube and Google Videos does not work on the forums I frequent.

I can post YouTube videos by using the following format:

[flash width=425 height=350]http://www.youtube.com/v/KaZLgEnka8w[/flash]

but this does not work for GoogleVideo or LiveVideo.

Do you know what WILL work for those?

Thanks,

Carl Nelson

Posted by: Carl Nelson at June 28, 2007 11:04 PM

Hello Dave. Thanks for the description on BBCode.

I was wondering if you could answer another question on this...

How do you set up the page to use this code? In other words, what do you need to put on the page in addition to the tags?

I don't know anything about programming, except that with html you put at the top and at the bottom, with the tags and content in between. Is there anything equivalent to that tag at the top and bottom in BBCode?

I am trying to post a message to a site that requires BBCode, but when I use the BBCode tags, it doesn't work. Nothing works, and I just get this text all bunched together, and I can't figure out how to use the code so I can have line breaks etc.

Any advice would be welcomed.

Posted by: craig at November 26, 2007 8:56 PM

how do i get symbols with this code?

Posted by: charlotte at June 3, 2008 10:13 AM

Thank you so much for this. I just made an account on Gaia Online and it required this BBCode and I was really confused as to what it was. I'm so used to HTML that this was just a different language... Now that I see the similarity, I just feel stupid haha.
Thanks again!
-Corrina

Posted by: Corrina Y at July 13, 2009 5:01 PM

[b][color=red]it wasn´t all but it was enough ![/b][/color]
thanks
[b]God[/b]bless you

Posted by: Eduardp at July 27, 2009 12:26 PM

hi dave,
i have one doubt, can i change the font using bbcode. here i am not talking about changing the size instead i would like to change the font style.

hope you understood what my doubt was...

please help... thanks..

Posted by: Gucci at January 2, 2010 10:15 AM

I have something to say, now that you mention it, but ...
Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you for all your efforts on this Web site by buying you a cup of coffee!

I do have a comment, now that you mention it!











Remember personal info?


Please note that I will never send you any unsolicited email. Ever.

While I'm at it, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site.








Ask Dave Taylor: The iPhone App: Advertisement



Follow me on Twitter @DaveTaylor

Search
Find just the answers you seek from among our 2300+ free tech support articles by using our Lijit search engine.


Help!





Subscribe to
Ask Dave Taylor!

Add to Google Reader
Add to My Yahoo!
Subscribe in NewsGator Online

RDF   XML

Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.


Recent Entries
Book Links
© 2002 - 2010 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site.

[whiteboard marker tray]
"Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.