Results 1 to 10 of 10

Thread: FLOAT bbcode

  1. #1
    Experienced vBulletin User
    Join Date
    Apr 2006
    Posts
    252

    FLOAT bbcode

    I just added a custom BBCODE tag to my site, which I'm glad to share. This code will cause a selected image (or any element, really) to use a float style.

    See it in action: http://www.tgreer.com/printforum/sho...?t=215&garpg=4

    The image is floated left.

    The code: [FLOAT=left]what you're floating[/FLOAT]

    Code:
    <div style="float:{option}; padding-left:12px; padding-right:12px;">{param}</div>
    And an icon you can use:

    I hardcoded the padding, because as far as I know you can't pass two options into a BBCODE. Adjust to fit.
    Last edited by Coder1; 04-27-2006 at 11:21 PM.

  2. #2
    Moody Admin Peggy's Avatar
    Join Date
    Jan 2005
    Location
    Youngstown, OH
    Posts
    12,414
    interesting...

  3. #3
    vBFAQ Adminstrator Joeychgo's Avatar
    Join Date
    Jan 2005
    Location
    Chicago, IL
    Posts
    6,504
    Whats floating? I must be missing something...

  4. #4
    Moody Admin Peggy's Avatar
    Join Date
    Jan 2005
    Location
    Youngstown, OH
    Posts
    12,414
    whew! I'm glad I'm not the only one, lol

  5. #5
    Experienced vBulletin User
    Join Date
    Apr 2006
    Posts
    252
    Refers to the CSS "float" style. As it is now, if you include an image, it will simply display as a block, on its own, with any text being above or below it in the message. If you follow the link I provided, you'll see that the image is "floated" to the left of the text, because of the bbcode:

    Code:
    [FLOAT=left][IMG]myimage.gif[/IMG][/FLOAT]
    I needed it to provide a sleeker more "realistic" look to my articles, which have sidebar images. Another example from the same article.

    Think of it as putting your image in one "column", your paragraph in another.

  6. #6
    Happy to admin admin John's Avatar
    Join Date
    Feb 2006
    Location
    My Synths :) and Wales
    Posts
    735
    I also added some BBCodes that use imgleft and imgright to show a left aligned and right aligned image on a page

    <div align="left"><img align="left" src="{param}" hspace="3" alt=""/></div>

    Here's an example of an entry on my site that uses both in a thread...

    http://www.themouthpiece.com/vb/showthread.php?t=19731

  7. #7
    Experienced vBulletin User
    Join Date
    Apr 2006
    Posts
    252
    Excellent - same idea, different technique. I'm in the habit of using CSS wherever I can.

  8. #8
    Experienced vBulletin User
    Join Date
    Mar 2006
    Posts
    129
    Quote Originally Posted by John
    I also added some BBCodes that use imgleft and imgright to show a left aligned and right aligned image on a page

    <div align="left"><img align="left" src="{param}" hspace="3" alt=""/></div>

    Here's an example of an entry on my site that uses both in a thread...

    http://www.themouthpiece.com/vb/showthread.php?t=19731
    Hi John

    I don't understand most of the technical stuff on that linked page, but I sure enjoyed reading your interview with Steve Hackett. And one of my youngsters, Jodie, who is a saxophonist/keyboard player/budding composer, currently doing a BTEC National Diploma in Music Technology has read it. She loved it and wants to show her class at Bridwater College MT section. If that's OK with you, of course?

    Cheers

    Biggles

  9. #9
    Happy to admin admin John's Avatar
    Join Date
    Feb 2006
    Location
    My Synths :) and Wales
    Posts
    735
    Most certainly it is Biggles... I'd be delighted for her to use it wherever she can. I also have an interview planned with Rick Wakeman (ex Yes) sometime soon. Just waiting to hear back from his management company.

  10. #10
    Moody Admin Peggy's Avatar
    Join Date
    Jan 2005
    Location
    Youngstown, OH
    Posts
    12,414
    Quote Originally Posted by John
    I also added some BBCodes that use imgleft and imgright to show a left aligned and right aligned image on a page

    <div align="left"><img align="left" src="{param}" hspace="3" alt=""/></div>

    Here's an example of an entry on my site that uses both in a thread...

    http://www.themouthpiece.com/vb/showthread.php?t=19731
    nicely done... I've been using the same layout in html on websites for years. You can see it here on my photography website: Personally Yours Photography

    (it's not finished and some links don't work)

Similar Threads

  1. MLG BBCode PLEASE LOOK!
    By Scott X in forum vBulletin Discussion and Questions
    Replies: 0
    Last Post: 01-28-2008, 09:57 PM
  2. BBCode Help Please! (V3.5.7)
    By robertark in forum Setting up and Customizing your Forum
    Replies: 0
    Last Post: 12-11-2007, 11:40 PM
  3. BBCode help
    By mikedude43 in forum vBulletin Discussion and Questions
    Replies: 2
    Last Post: 10-27-2007, 07:03 PM
  4. Need coding help (CSS Float)
    By Caddyman in forum HTML, Design, DHTML, CSS
    Replies: 16
    Last Post: 06-26-2007, 08:37 PM
  5. WMV bbcode
    By caaf in forum Hack Discussion and Requests
    Replies: 0
    Last Post: 01-27-2007, 06:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •