HTML5 <iframe> 标签、HTML5 <input> 标签
    		       		warning:
    		            这篇文章距离上次修改已过451天,其中的内容可能已经有所变动。
    		        
        		                
                HTML5 <iframe> 标签和 <input> 标签是HTML语言中的基本元素,用于在网页中创建不同的内容和功能。
<iframe>标签:
<iframe> 标签用于在网页中嵌入另一个网页。例如,你可以在自己的网站上显示另一个网站的内容。
HTML 代码示例:
<iframe src="https://www.example.com" width="600" height="400">
  <p>Your browser does not support iframes.</p>
</iframe>在这个例子中,src 属性指定了要嵌入的网页的URL,width 和 height 属性指定了iframe的宽度和高度。如果浏览器不支持 <iframe>,它将显示 <p> 标签中的文本。
<input>标签:
<input> 标签用于收集用户信息。根据 type 属性的不同值,<input> 可以有多种形态,例如文本输入框、复选框、单选按钮、文件上传等。
HTML 代码示例:
<input type="text" name="username" placeholder="Enter your username">
<input type="password" name="password" placeholder="Enter your password">
<input type="radio" name="gender" value="male"> Male
<input type="radio" name="gender" value="female"> Female
<input type="file" name="fileupload">
<input type="submit" value="Submit">在这个例子中,第一个 <input> 标签创建了一个文本输入框,用于输入用户名;第二个 <input> 标签创建了一个密码输入框;第三个和第四个 <input> 标签创建了一组单选按钮;第五个 <input> 标签允许用户上传文件;最后一个 <input> 标签创建了一个提交按钮。
评论已关闭