7.36. Bootstrap5 form floating label

发布时间 : 2025-10-25 13:35:32 UTC      

Page Views: 9 views

By default, the tag content is generally displayed in the input at the top of the input box:

Image0

Using floating tags, you can use the input insert a label in the input box and click input float them to the top when you enter the boxes

Image1

7.36.1. Bootstrap instance

<div class="form-floating mb-3 mt-3"> <input type="text" class="form-control" id="email" placeholder="Enter email" name="email"> <label for="email">Emaillabel> div> <div class="form-floating mt-3 mb-3"> <input type="text" class="form-control" id="pwd" placeholder="Enter password" name="pswd"> <label for="pwd">Passwordlabel> div>    

Note:

Text box

Text box textarea you can also have a floating effect:

7.36.2. Bootstrap instance

<div class="form-floating"> <textarea class="form-control" id="comment" name="text" placeholder="Comment goes here">textarea> <label for="comment">Commentslabel> div>    

Selection box

We can use a floating tag on the selection menu, which will always be displayed in the upper-left corner of the selection menu and will not have aclick-and-float effect:

7.36.3. Bootstrap instance

<div class="form-floating"> <select class="form-select" id="sel1" name="sellist"> <option>1option> <option>2option> <option>3option> <option>4option> select> <label for="sel1" class="form-label">Select list (select one):label> div>      
                
                
            
        
        
《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。