This article mainly introduces how to set the height of the label tag in HTML. There is also an introduction to how to use HTML label tags. Let's take a look at this article about html label tags
First of all, let's take a look at how to set the height of label tags in html:
The label in HTML defines text labels for form elements.
If you want to set the height, you need to set the display attribute of
The conditions given in this picture need to set the width of
<label class=' p1' style='dispaly: inline-block'>姓名</label>
Then set
<style> .p1{ width:80px; } </style>
in the head so that the width is adjusted.
Now let’s talk about how to use the html label label:
The label label is a label used as a "label" in the form of the html code. Do not I was confused by this sentence. This "label" is not that label. Its function is to add words before the form to describe the form.
In the
label, you will find that if there is no text between any labels, the form will be displayed incorrectly. At this time, this label is introduced Label, the usage method is as follows:<form id="dreamduform" action="http://www.php.cn/dreamdu.php" method="post"> <label for="contactus">PHP中文网</label> <textarea cols="50" rows="10" id="contactus"> 这里是PHP中文网 </textarea> </form>
In the above example, the function of the for attribute is the id of the form described by this label. It seems that this attribute can be valued in js and the form id can be obtained. That's what I understand, but I haven't actually tested it.
The above is all about setting the height and usage of html label tags (if you want to learn more programming knowledge, come to the PHP Chinese website. There are more courses and better teachers for you. Answer), if you have any questions, you can leave a message below.
【Editor’s Recommendation】
How to write html space code? Summary of the expression of html space code
The above is the detailed content of How to set the height of label tag in html? Introduction to how to use label tags. For more information, please follow other related articles on the PHP Chinese website!