简体   繁体   中英

Proportionally resize an image with just HTML and using a input tag?

<form name="loginform" action="URL_TO_LOGIN_PAGE_GOES_HERE" method="post">
<input type="hidden" name="log" value="USERNAME" />
<input type="hidden" name="pwd" value="PASSWORD" />
<input type="submit" value="" class="mtrgimg" style="background:url(http://aff.securesb.info/accounts/default1/banners/b40a4792.png) center no-repeat; width:145px; height:145px; border:none; cursor:pointer;" />
</form>

http://jsfiddle.net/kr3n4/1/

I would like for the image in this button to be proportionally resized to 145x145. I do not have access to the stylesheet so I cannot use any CSS. Also, cannot use JavaScript. There must be a way to resize using just HTML.

Also, when it is all said and done, I would also like this button to open its link in a new new tab or window.

I would like for the image in this button to be proportionally resized to 145x145. I do not have access to the stylesheet so I cannot use any CSS. Also, cannot use JavaScript. There must be a way to resize using just HTML.

Well, your style tag in the <input> is (inline) CSS. You can use that and follow the methods discussed in this thread , for example.

Also, when it is all said and done, I would also like this button to open its link in a new new tab or window.

You can put target="_blank" on the <form> tag to open the page set as the action in a new window.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM