Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

4
HOWTO: square an image that has a maximum width defined by twitter bootstrap column width
Post Body

hi all,

I am looking for a for dummies way of squaring an div (containing an image of unknown size and aspect ratio), where the only parameter I supply is the width of the the div using bootstrap notation, ie.

    <div class="col-sm-9" style="max-height: col-sm-9">
          <img src="some.img" style="width: 100%; height:auto">
    </div>

i have it on good authority it can be done using jquery but i have never used jquery before, and do not even know where to start with this,

any help is much appreciated!

thanks!

Author
Account Strength
100%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
10,703
Link Karma
1,089
Comment Karma
9,370
Profile updated: 2 hours ago
Posts updated: 10 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
9 years ago