放在哪里< label>围绕其他html元素或不? [英] Where to put <label> around other html element or not?

查看:110
本文介绍了放在哪里< label>围绕其他html元素或不?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在哪里放置其他html元素? / p>

 < label> Url:
< input type =textsize =350/>
< / label>

选项2:

 <标签> URL:其中/标签> 
< input type =textsize =350/>

谢谢

解决方案 div>

第二个绝对更好,它允许你分开设计样式。



您也可以使用for属性将其绑定到输入字段:



http://www.w3schools .com / tags / att_label_for.asp

Where to put around other html element or not?

Option1- put around input element :

<label>Url:
        <input type="text" size="350"/>
</label>

Option2:

<label>Url:</label>
<input type="text" size="350"/>

Thanks

解决方案

The second is definitely better, it allows you to style separately.

You can also use the "for" attribute to bind it to an input field:

http://www.w3schools.com/tags/att_label_for.asp

这篇关于放在哪里&lt; label&gt;围绕其他html元素或不?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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