bootstrap表单的基本操作

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>bootstrap表单的基本操作</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <script src="js/jquery-3.3.1.min.js"></script>  
    <script src="js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-12">
            <form action="" role="form">
                <fieldset>
                    <legend>用户登陆</legend>
                    <div class="form-group">
                        <label for="name">用户名登陆:</label>
                        <input type="text" class="form-control" id="name" placeholder="UserName">
                        <p class="help-block">可以用手机号和邮箱登陆</p>
                    </div>
                    <div class="form-group">
                        <label for="password">密码:</label>
                        <input type="text" class="form-control" id="password" placeholder="PassWord">
                        <p class="help-block">密码不得少于6位</p>
                    </div>
                </fieldset>
                <button type="submit" name="button" class="btn btn-info btn-block">提交</button>
            </form>
        </div>
    </div>
</div>
</body>
</html>



其他的请参考:https://v3.bootcss.com/css/#forms

<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>bootstrap表单自适用设计</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <script src="js/jquery-3.3.1.min.js"></script>  
    <script src="js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">

            <form action="" role="form" class="form-horizontal">
                <fieldset>
                    <legend class="text-center">用户登陆</legend>
                    <div class="form-group">
                        <label for="name" class="col-md-2 control-label">用户名登陆:</label>
                        <div class="col-md-10">
                            <input type="text" class="form-control" id="name" placeholder="UserName">
                        </div>   
                    </div>
                    <div class="form-group">
                        <label for="password" class="col-md-2 control-label">密码:</label>
                        <div class="col-md-10">
                            <input type="text" class="form-control" id="password" placeholder="PassWord">
                        </div>
                        
                        
                    </div>                    
                </fieldset>
                <div class="form-group">
                    <div class="col-md-offset-2 col-md-10">
                       <button type="submit" name="button" class="btn btn-info">提交</button> 
                    </div>
                    
                </div>
            </form>


</div>
</body>
</html>



猜你喜欢

转载自blog.csdn.net/samcphp/article/details/79774306