Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6071329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:02:05+00:00 2026-05-23T10:02:05+00:00

I have a bbcode parser that turns, [img]imageurl[/img] bbcodes into, <img src=imageurl alt= />

  • 0

I have a bbcode parser that turns,

[img]imageurl[/img]

bbcodes into,

<img src="imageurl" alt="" /> 

The only problem is, I want to be able to enforce a maximum width and maximum height on these images without messing up the aspect ratio, but I cannot check the size and do resizing math before hand since the bbcode parser is not that smart. Is there a way to enforce an aspect ratio respecting maximum size of an image without any knowledge of the image’s dimensions using inline css or javascript?

I know I could change the bbcode parser to set a maxwidth for the tag’s style, but this does not seem to work on IE6.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:02:06+00:00Added an answer on May 23, 2026 at 10:02 am

    use css:

    img {
      max-width:30em;
      max-height:10em;
    }
    

    probably combine with a container, so you only have images inside your bbcoded posts max-sized instead of every image on your site:

    div.post img { … }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a really simple Javascript BBCode Parser for client-side live preview (don't want
I have a bbcode parser which parse bbcode on the server side into html
I'm trying to do a bbcode parser class that can create personalyzed tags, but
Background I have written very simple BBCode parser using C# which transforms BBCode to
Here is my problem. It's probably a simple fix. I have a regex that
I have a client that wants to insert videos, images, form elements, etc. into
I decided to write a small parser to parse BBCode and return properly formatted
I'm building a blog that should parse bbcode tags like this: Input: <youtube=http://www.youtube.com/watch?v=VIDEO_ID&feature=channel> Output:
I am using a little BBCode parsing function for a forum I have. It
HI, I have a NSString that cotains a lot of text. Inside the text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.