Dynamically resize image

Started by Joe, September 02, 2010, 01:16:52 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Joe

I've inherited this code from a previous developer:

<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" height="85%" />


The intent there is to have the image be at 85% of the size of the site and the image dynamically scales proportionately if the user resizes the window...all the way down to fit on the iPhone/iPad. It works in Firefox but freaking Safari butchers it to death. I need to to work in all browsers. Anyone know how to accomplish this either via html or CSS?
Mac OS Sonoma 14.2.1 (c) | (retired)

The seven ages of man: spills, drills, thrills, bills, ills, pills and wills.

Syphon

Afraid of coding and not touching this.  <Backing out of this thread.>
Freelance Designer | Illustrator | Photo Editor
iMac • Mac OSX 10.15 Catalina
Affinity Publisher • Affinity Photo • Affinity Designer
Adobe InDesign • Adobe Photoshop • Adobe Illustrator
Adobe Acrobat

gnubler

Sorry, Joe. I'm backing out, too. Go ask the nerds at webdevforums, that's where I used to hang out.
Hicks • Cross • Carlin • Kinison • Parker • Stone •  Colbert • Hedberg • Stanhope • Burr

"As much as I'd like your guns I prefer your buns." - The G

Quote from: pspdfppdfx on December 06, 2012, 05:03:51 PM
So,  :drunk3: i send the job to the rip with live transparecy (v 1.7 or whatever) and it craps out with a memory error.

Member #14 • Size 5 • PH8 Unit 7 • Paranoid Misanthropic Doomsayer • Printing & Drinking Since 1998 • doomed ©2011 david

Joe

Quote from: gnubler on September 02, 2010, 06:49:50 PMSorry, Joe. I'm backing out, too. Go ask the nerds at webdevforums, that's where I used to hang out.

Shit, I was counting on you! :angry:
Mac OS Sonoma 14.2.1 (c) | (retired)

The seven ages of man: spills, drills, thrills, bills, ills, pills and wills.

Syphon

Well Joe, I believe you just found a way to clear a room. Or a thread in this case. :grin:
Freelance Designer | Illustrator | Photo Editor
iMac • Mac OSX 10.15 Catalina
Affinity Publisher • Affinity Photo • Affinity Designer
Adobe InDesign • Adobe Photoshop • Adobe Illustrator
Adobe Acrobat

gnubler

Cool, can we jack it now? I hate to see a fresh thread with so much potential just go to waste.
Hicks • Cross • Carlin • Kinison • Parker • Stone •  Colbert • Hedberg • Stanhope • Burr

"As much as I'd like your guns I prefer your buns." - The G

Quote from: pspdfppdfx on December 06, 2012, 05:03:51 PM
So,  :drunk3: i send the job to the rip with live transparecy (v 1.7 or whatever) and it craps out with a memory error.

Member #14 • Size 5 • PH8 Unit 7 • Paranoid Misanthropic Doomsayer • Printing & Drinking Since 1998 • doomed ©2011 david

Stiv

Quote from: gnubler on September 03, 2010, 07:01:56 AMCool, can we jack it now?

What you do in private is your own business.

Joe

#7
Well I figured out the answer in case anyone needs to know. Change

<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" height="85%" />

to

<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" />
Mac OS Sonoma 14.2.1 (c) | (retired)

The seven ages of man: spills, drills, thrills, bills, ills, pills and wills.

DigitalCrapShoveler

Quote from: Joe on September 03, 2010, 09:55:58 AMWell I figured out the answer in case anyone needs to know. Change

<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" height="85%" />
to

Quote<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" />

Whew! I'll sleep better.
Member #285 - Civilian

Joe

Quote from: DigitalCrapShoveler on September 03, 2010, 10:16:27 AM
Quote from: Joe on September 03, 2010, 09:55:58 AMWell I figured out the answer in case anyone needs to know. Change

<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" height="85%" />
to

Quote<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" />

Whew! I'll sleep better.

Which is why I posted the solution.
Mac OS Sonoma 14.2.1 (c) | (retired)

The seven ages of man: spills, drills, thrills, bills, ills, pills and wills.

DigitalCrapShoveler

Quote from: Joe on September 03, 2010, 10:32:44 AM
Quote from: DigitalCrapShoveler on September 03, 2010, 10:16:27 AM
Quote from: Joe on September 03, 2010, 09:55:58 AMWell I figured out the answer in case anyone needs to know. Change

<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" height="85%" />
to

Quote<img src="http://www.somesite.com/header.jpg" alt="Lamp" width="85%" />

Whew! I'll sleep better.

Which is why I posted the solution.

Goddamn, I'd admire you.
Member #285 - Civilian

gnubler

I "looked into it" a bit and noticed there are also techniques for sizing images with em units. I've never gotten into that.
Hicks • Cross • Carlin • Kinison • Parker • Stone •  Colbert • Hedberg • Stanhope • Burr

"As much as I'd like your guns I prefer your buns." - The G

Quote from: pspdfppdfx on December 06, 2012, 05:03:51 PM
So,  :drunk3: i send the job to the rip with live transparecy (v 1.7 or whatever) and it craps out with a memory error.

Member #14 • Size 5 • PH8 Unit 7 • Paranoid Misanthropic Doomsayer • Printing & Drinking Since 1998 • doomed ©2011 david

tapdn

backslash backslash semi-something something-or-the-other isn't it?
usually fried mate - sometimes pickled - often scrambled - never beaten
~ Sir B. Monsteaure
No, he's well within his rights to diss cake. Pie, on the other hand, is waaaayyyy off limits.
~Youston
I'm just a stupid printer WTF do I know
~Farabomb

Joe

Quote from: tapdn on September 03, 2010, 04:52:59 PMbackslash backslash semi-something something-or-the-other isn't it?

I thought that was the code for unlimited lives on The Legend of Zelda?
Mac OS Sonoma 14.2.1 (c) | (retired)

The seven ages of man: spills, drills, thrills, bills, ills, pills and wills.

Tracy

that's cool you figured it out, I took an html class awhile back, seems there's a lot more
ways to solve problems now.
I may have to check it out if I have any spare time someday :undecided: