How to bind label label to input label

autoload
Release: 2021-03-31 14:03:23
Original
7546 people have browsed it

How to bind label label to input label

1. Method one:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>表单</title>
</head>
<body>
   <form action="" style="display: grid;" method="POST">
     <div>
            <label for="username">账号:</label>  <!-- 利用id进行绑定 -->
            <input type="text" id="username">        
     </div>
   </form>
</body>
</html>
Copy after login

Method two:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>表单</title>
</head>
<body>
   <form action="" style="display: grid;" method="POST">
     <div>
            <label>账号:<input type="text" >  </label>
                  
     </div>
   </form>
</body>
</html>
Copy after login

Recommendation: "The most popular 5 html5 video tutorial recommendations"

The above is the detailed content of How to bind label label to input label. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!