Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I resize text AND images

Status
Not open for further replies.

CliveC

Programmer
Nov 21, 2001
1,222
US
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml"[/URL] xml:lang="en" lang="en">
<head><title>Smaller / L a r g e r</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<base href="[URL unfurl="true"]http://tubularity.com/resize/"[/URL] />
<style>body {background:green}
a           {text-decoration:none; color:black; background:silver}
a:hover     {color:red} 
div#text    {border: 1px solid; background:white; padding:2%}
img#monitor {width:10em}
</style><script type="text/javascript">
function ResizeDiv(val) {
rdiv = document.getElementById('text')
rdiv.style.fontSize=(parseFloat(rdiv.style.fontSize)+val)+"em"}
</script></head><body>
<a href="#" onclick="ResizeDiv(-0.2); return false">&nbsp;Smaller </a>
&nbsp;<a href="#" onclick="ResizeDiv(0.2); return false"> Larger </a>
<br /><br /><div id="text" style="font-size:1em; width:50%">
<img id="monitor" src="monitor.jpg" alt="" /><br /><br />
Yes! You can resize text and images.</div></body></html>

Clive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top