Home > Web Front-end > HTML Tutorial > How to set the height of label tag in html? Introduction to how to use label tags

How to set the height of label tag in html? Introduction to how to use label tags

寻∝梦
Release: 2018-09-04 16:09:21
Original
7674 people have browsed it

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=&#39; p1&#39; style=&#39;dispaly: inline-block&#39;>姓名</label>
Copy after login

Then set

<style>
.p1{
width:80px;
}
</style>
Copy after login

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="//m.sbmmt.com/dreamdu.php" method="post">
<label for="contactus">PHP中文网</label>
<textarea cols="50" rows="10" id="contactus">
这里是PHP中文网
</textarea>
</form>
Copy after login

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

How to wrap the html code tag? This article gives you a thorough understanding of the use of code phrases

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template