简体   繁体   English

仅使用HTML并使用输入标签按比例调整图像大小?

[英]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/ http://jsfiddle.net/kr3n4/1/

I would like for the image in this button to be proportionally resized to 145x145. 我希望此按钮中的图像按比例调整为145x145。 I do not have access to the stylesheet so I cannot use any CSS. 我无权访问样式表,因此无法使用任何CSS。 Also, cannot use JavaScript. 另外,不能使用JavaScript。 There must be a way to resize using just HTML. 必须有一种仅使用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. 我希望此按钮中的图像按比例调整为145x145。 I do not have access to the stylesheet so I cannot use any CSS. 我无权访问样式表,因此无法使用任何CSS。 Also, cannot use JavaScript. 另外,不能使用JavaScript。 There must be a way to resize using just HTML. 必须有一种仅使用HTML来调整大小的方法。

Well, your style tag in the <input> is (inline) CSS. 好吧,您在<input>中的style标签是(内联)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. 您可以在<form>标记上放置target="_blank" ,以在新窗口中打开作为action设置的页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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