Modify my Bootstrap form with style

2

On all sides I see how to make a bootstrap form but not how to edit it in style. I have already prepared a secure login form. But the truth is, it's very "shabby" I'd like to make it cool

This is my form

<div class="container">
    <div class="row">
        <div class="col-md-4">
            <form action="index.php" method="post">
                <div class="form-group">    
                    <label for="usu">Usuario:</label>
                    <input class="form-control" id="usu" type="text" name="txtlogin" required="true">
                </div>

                <div class="form-group">
                    <label for="pass">Password:</label>
                    <input class="form-control" id="pass" type="password" name="txtpass" required="true">
                </div>

                <input type="submit" class="btn btn-primary" value="Ingresar">  
            </form>
            <br>
            <div class="msg" id="msg">

            </div>
        </div>
    </div>
</div>

What does this do:

It's quite simple and also stuck to the left, I do not understand why the container does not put it centered ...

Well, what I was asking, with bootstrap can I make my form like this ?:

Or should I look for other types of forms? How could I make my form beautiful? I know that you do "modern" things jejeje

Thank you very much!

    
asked by Vidal 20.03.2018 в 22:56
source

1 answer

4

Any form can be done in Bootstrap. Everything depends on creativity, it's playing with classes, creating CSS styles, etc.

I leave it form, which is one of thousands of examples that can be done.

.card-container.card {
    max-width: 350px;
    padding: 40px 40px;
}

.btn {
    font-weight: 700;
    height: 36px;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
    cursor: default;
}

/*
 * Card component
 */
.card {
    background-color: #F7F7F7;
    /* just in case there no content*/
    padding: 20px 25px 30px;
    margin: 0 auto 25px;
    margin-top: 50px;
    /* shadows and rounded borders */
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
    border-radius: 2px;
    -moz-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
    -webkit-box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
}

.reauth-email {
    display: block;
    color: #404040;
    line-height: 2;
    margin-bottom: 10px;
    font-size: 14px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.form-signin #inputEmail,
.form-signin #inputPassword {
    direction: ltr;
    height: 44px;
    font-size: 16px;
}

.form-signin input[type=email],
.form-signin input[type=password],
.form-signin input[type=text],
.form-signin button {
    width: 100%;
    display: block;
    margin-bottom: 10px;
    z-index: 1;
    position: relative;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

.form-signin .form-control:focus {
    border-color: rgb(104, 145, 162);
    outline: 0;
    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgb(104, 145, 162);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgb(104, 145, 162);
}

.btn.btn-signin {
    /*background-color: #4d90fe; */
    background-color: rgb(104, 145, 162);
    /* background-color: linear-gradient(rgb(104, 145, 162), rgb(12, 97, 33));*/
    padding: 0px;
    font-weight: 700;
    font-size: 14px;
    height: 36px;
    -moz-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    border: none;
    -o-transition: all 0.218s;
    -moz-transition: all 0.218s;
    -webkit-transition: all 0.218s;
    transition: all 0.218s;
}

.btn.btn-signin:hover,
.btn.btn-signin:active,
.btn.btn-signin:focus {
    background-color: rgb(12, 97, 33);
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->

<!--
    you can substitue the span of reauth email for a input with the email and
    include the remember me checkbox
    -->
    <div class="container">
        <div class="card card-container">
          <h1>Login</h1>
            <p id="profile-name" class="profile-name-card"></p>
            <form class="form-signin" action="index.php" method="post">
                <span id="reauth-email" class="reauth-email"></span>
                <input type="email" id="usu" class="form-control" placeholder="Usuario" required autofocus>
                <input type="password" id="pass" class="form-control" placeholder="Password" required>                
                <button class="btn btn-lg btn-primary btn-block btn-signin" type="submit">Ingresar</button>
            </form>
        </div>
    </div>
    
answered by 20.03.2018 / 23:31
source