jwhite68 Posted October 5, 2007 Share Posted October 5, 2007 I have the following code: echo '<A HREF="'.$domain.'register.php" ><IMG SRC="image/promo.gif" style="width:50%; height:50%;" border="1" ALT="Click here to register"></A>'; I was expecting it to reduce the image promo.gif proportionately by 50%. Instead it appears as a single horizontal strip. Can anyone tell me where I am going wrong? Quote Link to comment https://forums.phpfreaks.com/topic/71968-how-to-propertinally-reduce-percent-of-image-displayed-on-img-src/ Share on other sites More sharing options...
Mr P!nk Posted October 5, 2007 Share Posted October 5, 2007 try <input name="register" type="image" src="image/promo.gif" alt="Click here to register" title="Register" width="50%" height="50%" border="0" onClick="this.form.action='$domain.'register.php';"/> NOT TESTED but should work Quote Link to comment https://forums.phpfreaks.com/topic/71968-how-to-propertinally-reduce-percent-of-image-displayed-on-img-src/#findComment-362496 Share on other sites More sharing options...
jwhite68 Posted October 5, 2007 Author Share Posted October 5, 2007 I have it set to this in my code: <input name="register" type="image" src="elements/promo.gif" alt="Click here to register and upload properties for FREE!" title="Register" width="50%" height="50%" border="1" onClick="this.form.action='$domain.'register.php';"/> But it doesnt display the image or alt text etc at all now. I have tried to play with it to get it to work, but must be missing something. Quote Link to comment https://forums.phpfreaks.com/topic/71968-how-to-propertinally-reduce-percent-of-image-displayed-on-img-src/#findComment-362505 Share on other sites More sharing options...
Mr P!nk Posted October 5, 2007 Share Posted October 5, 2007 have you placed the whole thing inside <form method="post" enctype="multipart/form-data"> <input name="register" type="image" src="elements/promo.gif" alt="Click here to register and upload properties for FREE!" title="Register" width="50%" height="50%" border="1" onClick="this.form.action='$domain.'register.php';"/> </form> ive just tested the code and i get the image fine hmmm Quote Link to comment https://forums.phpfreaks.com/topic/71968-how-to-propertinally-reduce-percent-of-image-displayed-on-img-src/#findComment-362511 Share on other sites More sharing options...
Mr P!nk Posted October 5, 2007 Share Posted October 5, 2007 or try <form method="post" enctype="multipart/form-data" action="register.php"> <input name="register" type="image" src="" alt="Click here to register" title="Register" width="50%" height="50%" border="0"/> </form> Quote Link to comment https://forums.phpfreaks.com/topic/71968-how-to-propertinally-reduce-percent-of-image-displayed-on-img-src/#findComment-362513 Share on other sites More sharing options...
d22552000 Posted October 8, 2007 Share Posted October 8, 2007 just by reading your topic name )and not having time to read responses( suprisingly within the DTDof XHTML 1.1 Strict you can change an image by % "width='10%' height='10%'" and its perfectly valid. Quote Link to comment https://forums.phpfreaks.com/topic/71968-how-to-propertinally-reduce-percent-of-image-displayed-on-img-src/#findComment-364896 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.