src
HTML <input> src 属性
带有图像提交按钮的 HTML 表单:
<form action="/examples/web/html_input_align/">
First name: <input type="text" name="FirstName"/><br/>
<input type="image" src="/demo_source/images/submit.gif" alt="Submit" width="48" height="48"/>
</form>
定义和用法
src 属性规定显示为提交按钮的图像的 URL。
警告
注意:src 属性对于 <input type="image">
是必需的属性,且只能与 <input type="image">
配合使用。
HTML 4.01 与 HTML5之间的差异
无。
语法
<input src="*URL*">
属性值
值 | 描述 |
---|---|
URL | 规定作为提交按钮来使用的图像的 URL。 可能的值: -> 绝对 URL - 指向另一个网站(比如 src="http://www.example.com/submit.gif") -> 相对 URL - 指向网站内的一个文件(比如 src="submit.gif") |