BookmarkSubscribeRSS Feed
gzr2mz39
Quartz | Level 8
Is there a way to change the height and width of apple.png (eg height=170 width=170)?

ods text = '' < a href = '' '' www. sas . com '' '' target=_blank >
~ S = {preimage = ''''
C:/apple.png''''} '';
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
In my experience, it's always better to have your image file (in this case, apple.png) sized close to what you want it to be. When you use ODS TEXT= with ODS HTML, for example, if you have THIS ODS TEXT= option:
[pre]
ods text="~S={preimage='kermit.jpg'} Kermit The Frog";
[/pre]

Then, the generated HTML is this:
[pre]
<div class="l UserText"><img alt="" src="kermit.jpg"><span> Kermit The Frog</span></div>
[/pre]

As you can see, the PREIMAGE attribute only is used for the IMG tag's SRC= attribute -- there is no HEIGHT= or WIDTH= style attribute available to be changed. The reason why can be found in the W3C spec for the IMG tag.

The recommendation from the W3C http://www.w3schools.com/tags/att_img_width.asp is that:

quote
Tip: Do not rescale images with the height and width attributes! Downsizing a large image with the height and width attributes forces a user to download the large image (even if it looks small on the page). The correct method is to rescale the image with a program, before using it on a page.
endquote


cynthia
gzr2mz39
Quartz | Level 8
OK.
Thank you.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 3057 views
  • 1 like
  • 2 in conversation