Question

i created a simple login form with bootstrap and this is the code:

{% block stylesheets %}
<link href="{{asset('bundles/examens/css/style_ar.css') }}" rel="stylesheet" type="text/css" media="all">
<link href="{{asset('bundles/examens/bootstrap/css/bootstrap.min.css') }}" rel="stylesheet" type="text/css" media="all">
<link href="{{asset('bundles/examens/bootstrap/css/bootstrap.css') }}" rel="stylesheet" type="text/css" media="all">
<link href="{{asset('bundles/examens/bootstrap/css/bootstrap-responsive.min.css') }}" rel="stylesheet" type="text/css" media="all">
<link href="{{asset('bundles/examens/bootstrap/css/bootstrap-responsive.css') }}" rel="stylesheet" type="text/css" media="all">
{% endblock %}

{% if error %}
<div>{{ error.message }}</div>
{% endif %}

<div class="container">
    <div class="row">
        <div class="col-md-4 col-md-offset-7">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><strong>Sign in </strong></h3>
                </div>
                <div class="panel-body">
                    <form class="form-control" action="{{ path('login_check') }}" method="post" role="form">
                        <div class="form-group">
                            <label for="username" class="col-sm-3 control-label">Username:</label>
                            <div class="col-sm-9">
                                <input type="text" id="username" name="_username" value="{{ last_username }}" />
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="password" class="col-sm-3 control-label">Password:</label>
                            <div class="col-sm-9">
                                <input type="password" id="password" name="_password" />
                            </div>
                        </div>
                        <div class="form-group last">
                            <div class="col-sm-offset-3 col-sm-9">
                                <button type="submit" class="btn btn-success btn-sm">login</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

but the problem is that the view of this login page is not like what it should be, it should be like this Login page

but a got a very simple login page without any effects of the classes of bootstrap. where is the problem??

Was it helpful?

Solution

It looks like you're trying to use Bootstrap 3 markup, but are referencing Bootstrap 2 css files. For example, I see that you're including bootstrap-responsive.min.css, and this is not part of Bootstrap 3.

Why don't you try referencing the Bootstrap 3 files from Bootstrap CDN? The only link you need for css is http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top