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
Diamond | Level 26
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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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