BB Code

Giải thích

BB code là một bộ của các tag dựa trên ngôn ngữ HTML mà bạn có thể đã từng dùng. Chúng cho phép bạn thêm các định dạng vào bài viết của mình giống như ngôn ngữ HTML có thể hiển thị, nhưng có cú pháp đơn giản hơn và sẽ bao giờ phá vỡ bố cục của trang bạn đang xem. Khả năng để sử dụng BB code được thiết lập theo từng diễn đàn bởi người quản trị, vì vậy bạn nên kiểm tra Nội quy diễn đàn khi bạn đăng một bài viết mới.

Dưới đây là danh sách các BB code bạn có thể dùng để định dạng văn bản bài viết của mình.

Danh sách BB code

  1. Đậm / Nghiêng / Gạch chân
  2. Màu sắc
  3. Kích thước
  4. Phông chữ
  5. Highlight
  6. Trái / Phải / Giữa
  7. Thụt lề
  8. Liên kết email
  9. Siêu liên kết URL
  10. Liên kết đến chủ đề
  11. Liên kết đến bài trả lời
  12. Danh sách / Danh sách nâng cao
  13. Ảnh
  14. Video/Clip
  15. Mã nguồn PHP
  16. Mã nguồn HTML
  17. Trích dẫn
  18. Dừng phân tích mã BB code
  19. Đính kèm
Cách sử dụng BB Code sai:
  • [url] www.example.com [/url] - không chèn dấu cách (space - phím dài nhất) giữa các mã trong ngoặc vuông và các nội dung đang áp dụng mã vào .
  • [email]myname@domain.com[email] - khung cuối cùng phải bao gồm một dấu gạch chéo ([/email])

Đậm / Nghiêng / Gạch chân

Thẻ [b], [i] và [u] cho phép bạn tạo ký tự in đậm, in nghiêng và gạch chân.

    • [b]giá trị[/b]
    • [i]giá trị[/i]
    • [u]giá trị[/u]
    Cách dùng
    • [b]chữ này in đậm[/b]
    • [i]chữ này in nghiêng[/i]
    • [u]chữ này gạch chân[/u]
    Ví dụ
    • chữ này in đậm
    • chữ này in nghiêng
    • chữ này gạch chân
    Khi hiển thị

Màu sắc

Thẻ [color] cho phép bạn thay đổi màu sắc của chữ

  • [color=Tùy chọn]giá trị[/color]
    Cách dùng
  • [color=blue]chữ này màu xanh[/color]
    Ví dụ
  • chữ này màu xanh
    Khi hiển thị

Kích thước

Thẻ [size] cho phép bạn thay đổi kích thước của dòng ký tự bạn chọn.

  • [size=Tùy chọn]giá trị[/size]
    Cách dùng
  • [size=+2]chữ này to gấp hai lần bình thường[/size]
    Ví dụ
  • chữ này to gấp hai lần bình thường
    Khi hiển thị

Phông chữ

thẻ [font] cho phép bạn thay đổi phông chữ của đoạn bạn chọn.

  • [font=Tùy chọn]giá trị[/font]
    Cách dùng
  • [font=courier]chữ này dùng phông courier[/font]
    Ví dụ
  • chữ này dùng phông courier
    Khi hiển thị

Trái / Phải / Giữa

Thẻ [left], [right] và [center] cho phép bạn thay đổi cách căn lề của văn bản bạn chọn.

    • [left]giá trị[/left]
    • [center]giá trị[/center]
    • [right]giá trị[/right]
    Cách dùng
    • [left]this text is left-aligned[/left]
    • [center]this text is center-aligned[/center]
    • [right]this text is right-aligned[/right]
    Ví dụ
  • this text is left-aligned
    this text is center-aligned
    this text is right-aligned
    Khi hiển thị

Thụt lề

The [indent] tag allows you to indent your text.

  • [indent]giá trị[/indent]
    Cách dùng
  • [indent]this text is indented[/indent]
    Ví dụ
  • this text is indented
    Khi hiển thị

Liên kết email

The [email] tag allows you to link to an email address. You can include an optional parameter to 'name' your link.

    • [email]giá trị[/email]
    • [email=Tùy chọn]giá trị[/email]
    Cách dùng
    • [email]j.doe@example.com[/email]
    • [email=j.doe@example.com]Click Here to Email Me[/email]
    Ví dụ
  • Khi hiển thị

Siêu liên kết URL

The [url] tag allows you to link to other websites and files. You can include an optional parameter to 'name' your link.

Liên kết đến chủ đề

The [thread] tag allows you to link to threads by specifying the thread id. You can include an optional parameter to 'name' your link.

    • [thread]threadid[/thread]
    • [thread=threadid]giá trị[/thread]
    Cách dùng
    • [thread]42918[/thread]
    • [thread=42918]Click Me![/thread]
    (Note: The threadid/postid is just an example and may not link to a valid thread/post.)
    Ví dụ
  • Khi hiển thị

Liên kết đến bài trả lời

The [post] tag allows you to link to posts by specifying the post id. You can include an optional parameter to 'name' your link.

Danh sách

The [list] tag allows you to create simple, bulleted lists without specifying an option. Within the value portion, each bullet is denoted by the [*] tag.

  • [list]giá trị[/list]
    Cách dùng
  • [list]
    [*]list item 1
    [*]list item 2
    [/list]
    Ví dụ
    • list item 1
    • list item 2
    Khi hiển thị

Danh sách nâng cao

The [list] tag allows you to create advanced lists by specifying an option. The option should have a value of 1 (for a numbered list) or A (for an alphabetic with capital letters list) or a (for an alphabetic with lowercase letters list) or I (for a numbered with capital Roman numeral list) or i (for a numbered with small Roman numeral list).

  • [list=Tùy chọn]giá trị[/list]
    Cách dùng
  • [list=1]
    [*]list item 1
    [*]list item 2
    [/list]

    [list=A]
    [*]list item 1
    [*]list item 2
    [/list]

    [list=a]
    [*]list item 1
    [*]list item 2
    [/list]
    Ví dụ
    1. list item 1
    2. list item 2
    1. list item 1
    2. list item 2
    1. list item 1
    2. list item 2
    Khi hiển thị

Ảnh

The [img] tag allows you to embed images within your posts. You can also combine this tag with the [url] tag to make images become links.

  • [img]giá trị[/img]
    Cách dùng
    • [img]https://diendanhiv.vn/images/statusicon/forum_new-48.png[/img] (Not linked)
    • [url=http://www.example.com] [img]https://diendanhiv.vn/images/statusicon/forum_new-48.png[/img] [/url] (Linked)
    Ví dụ
    • (Not linked)
    • (Linked)
    Khi hiển thị

Video/Clip

The [video] tag allows you to embed videos from various video services within your posts.

  • [video]giá trị[/video]
    Cách dùng
    • [video=youtube;eOUq4Z6R7xI]http://www.youtube.com/watch?v=eOUq4Z6R7xI[/video]
    Ví dụ
    Khi hiển thị

The [code] tag switches to a fixed-width (monospace) font and preserves all spacing.

  • [code]giá trị[/code]
    Cách dùng
  • [code]
    <script type="text/javascript">
    <!--
        alert("Hello world!");
    //-->
    </script>
    [/code]
    Ví dụ
  • Mã:
    <script type="text/javascript">
    <!--
    	alert("Hello world!");
    //-->
    </script>
    Khi hiển thị

Mã nguồn PHP

The [php] tag performs the same function as the [code] tag, but also adds syntax highlighting for PHP code. Although it is designed for PHP, it may correctly highlight some other C-like languages.

  • [php]giá trị[/php]
    Cách dùng
  • [php]
    $myvar = 'Hello World!';
    for ($i = 0; \$i < 10; \$i++)
    {
        echo $myvar . "\n";
    }
    [/php]
    Ví dụ
  • Mã nguồn PHP:
    $myvar 'Hello World!';
    for (
    $i 0$i 10$i++)
    {
        echo 
    $myvar "\n";

    Khi hiển thị

Mã nguồn HTML

The [html] tag allows you to perform syntax highlighting for HTML code.

  • [html]giá trị[/html]
    Cách dùng
  • [html]
    <img src="image.gif" alt="image" />
    <a href="testing.html" target="_blank">Testing</a>
    [/html]
    Ví dụ
  • Mã nguồn HTML:
    <img src="image.gif" alt="image" />
    <a href="testing.html" target="_blank">Testing</a>
    Khi hiển thị

Trích dẫn

The [quote] tag allows you to attribute text to someone else.

    • [quote]Trích dẫn[/quote]
    • [quote=Tên tài khoản]giá trị[/quote]
    Cách dùng
    • [quote]Lorem ipsum dolor sit amet[/quote]
    • [quote=John Doe]Lorem ipsum dolor sit amet[/quote]
    • [quote=John Doe;612574]Lorem ipsum dolor sit amet[/quote]
    Ví dụ
    • Lorem ipsum dolor sit amet
    • Trích dẫn Gửi bởi John Doe
      Lorem ipsum dolor sit amet
    • Trích dẫn Gửi bởi John Doe Xem bài viết
      Lorem ipsum dolor sit amet
    Khi hiển thị

Highlight

The [highlight] tag allows you to emphasize your text.

  • Cách dùng
    [highlight]giá trị[/highlight]
  • Ví dụ
    [highlight]this text is highlighted[/highlight]
  • Khi hiển thị
    this text is highlighted

Dừng phân tích mã BB code

The [noparse] tag allows you to stop the parsing of BB code.

  • [noparse][b]giá trị[/b][/noparse]
    Cách dùng
  • [noparse][b]Lorem ipsum dolor sit amet[/b][/noparse]
    Ví dụ
  • [b]Lorem ipsum dolor sit amet[/b]
    Khi hiển thị

Đính kèm

The [attach] tag allows you to display an attachment in your post rather than at the bottom. It will only display attachments that belong to the post in which it is utilized.

  • [attach]attachmentid[/attach]
    Cách dùng
  • [attach]12345[/attach]
    Ví dụ
  • Khi hiển thị