如何使用HTML在表单上插入图像 [英] How do I insert images on a form using HTML

查看:173
本文介绍了如何使用HTML在表单上插入图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的问题,我尝试使用此代码插入图片,但它无法正常工作。
以下
代码:

this is my problem, i tried using this code to insert an image but it isn't working.
below is the code:

<! doctype html>
<html>
<head>
<title>LIBRARY REGISTRATION FORM</title>
<h1><p style="font-size: 20px; color: maroon; font-weight: bold; align = center;">AFRICAN UNIVERSITY</p></h1>
<p><br />
<h2><font color="maroon;" align="center;" hold=" /><body bgcolor = " white="/><br mode=" form="" aust-sa-2=" name = " library="" registration="" post=" action = " center="><br mode=" 2="><image src = " pictures.jpg=" border = " solid=" align = "></font></h2></p>

推荐答案

您的语法错误。如果你不记得语法,是什么阻止你在写任何东西之前查看一些HTML引用?它应该是
Your syntax is wrong. What prevents you from looking into some HTML reference before you write anything, if you don't remember the syntax? It should be
<img src="someFileOrUrl.jpg"/>



请参阅:< img> - HTML



此外,将任何与样式相关的属性写入标记真的很糟糕,不包括 class ,如果可能的话,也应该更好地限制使用。总是使用CSS。



-SA


Please see: <img> — HTML.

Also, it's really bad to write any style-related attributes to the tag, excluding class, which also should better be limited in use, if possible. Always use CSS.

—SA


你有很多错误和不成对的报价HTML中的标记令人惊讶,它可以呈现任何内容。此HTML格式错误。



如果您不打算为属性提供值,请不要将该属性放在标记中。



自HTML5起,不再支持 font 标记。改为使用CSS样式。



br 标签没有自己的任何属性,除了全局和事件属性,所以我不知道你认为模式,表单,名称,库,...属性将在其中做什么。完全删除它可能是最好的。



为什么要在某些属性的值中加上=符号?在 image 标记中,您为src属性分配了pictures.jpg =的值。除非服务器上的文件名实际上是pictures.jpg =,否则它不起作用。我怀疑=符号应该在那里。标签看起来应该更像这样:

You've got so many mistakes and unpaired quote marks in your HTML it's amazing it renders anything at all. This HTML is very badly malformed.

If you're not going to supply a value for an attribute do NOT put the attribute in the tag.

The font tag is no longer supported as of HTML5. Use CSS styles instead.

The br tag doesn't have any attributes of its own, outside of the global and events attributes, so I don't know what you think the mode, form, name, library, ... attributes are going to do in it. It would probably be best to remove it entirely.

Why are you putting "=" signs inside the values of some of your attributes? In your image tag, you have the src attribute assigned the value of "pictures.jpg=". Unless the filename on the server is actually "pictures.jpg=" it's not going to work. I doubt the "=" sign is supposed to be in there. The tag should look more like this:
<img src="pictures.jpg" />





这个HTML编写得很糟糕,似乎你不知道自己在做什么。我强烈建议你拿一本关于HTML和CSS的书并在你试图继续之前完成它们。



This HTML is so badly written it seems you have no idea what you're doing. I would HIGHLY suggest you pickup a book on HTML and CSS and work through them before you try to go any further.


这篇关于如何使用HTML在表单上插入图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆