/    Sign up×
Community /Pin to ProfileBookmark

Non-resizable div

I have a div in which I display images. If the image is bigger than the div size, then the div resizes itself – is there any way to turn this around so that if the image is bigger than the div, then the [B]image[/B] resizes itself.
Thanks,

IxxI

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisApr 27.2003 — This works in IE 5.5:
<div style="width: 200; height: 200">
<img src="lilguy2.gif" width=100% height=100%>
</div>
Copy linkTweet thisAlerts:
@IxxIauthorApr 27.2003 — Thanks for the reply gil, but is there a way to make so that if the image is smaller it does not resize itself - you see the div shows not just one but many pictures, and I want it so that if the image is small enough to fit in the div, then fine, but if it is too big [b]then[/b] it makes itself smaller, does that make sense?

Thanks again,

IxxI
Copy linkTweet thisAlerts:
@gil_davisApr 27.2003 — [b]if the image is small enough to fit in the div, then fine, but if it is too big then it makes itself smaller[/b][/quote]You should realize that if you need to use an IF statement in your question, then the answer will probably require some SCRIPT to accomplish your desires. CSS alone wil not accomplish your idea.

If you want a scripted answer, it woud be best to start a new post in the JS or DHTML forum.
Copy linkTweet thisAlerts:
@IxxIauthorApr 27.2003 — Thanks...
×

Success!

Help @IxxI spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...