/    Sign up×
Community /Pin to ProfileBookmark

DIV fits an image + left/right clickable zones (link)

Hello,
[B]A. CONTEXT[/B]
My album is generated by a batch script, but DOS cannot get the size of an image file. So, the a unique picture size is defined in the script.
[url]http://www.airfirst.ch/b1/album_im.html[/url] (IMAGE MAP version)
[url]http://www.airfirst.ch/b1/album_div.html[/url] (DIV version)

[B]B. NAVIGATION[/B]
– 2 half sensitive zones on each picture.
– Click on the left/right image side to go up/down.

[B]C. QUESTION[/B]
To avoid the problem with pictures having different size (pic. #2 [url]http://www.airfirst.ch/b1/PiCS/Pic002.JPG[/url] ),
how to make the DIV box to fit its content instead of using absolute value like:

[CODE]DIV.Box {position:relative;width:360Px;height:240Px;margin:10Px 0;}[/CODE]

?

PS: in my case, I use the image as backround of a DIV

Thanks and regards.

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@ryanbutlerOct 19.2008 — If I understand you correctly, set width to auto would allow it to fit any image size.
×

Success!

Help @samz 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 6.1,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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