1

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??

7
  • Can you add an image from your login or link to your login.. So I can see what is going on...? Commented May 13, 2014 at 9:41
  • unfortunately i can't put an image because i haven't enough reputations, but it is like when create it without any css just html code Commented May 13, 2014 at 9:49
  • are you sure all the bootstrap files and your own css file are loaded correctly? Commented May 13, 2014 at 9:55
  • Yes i just edited my post Commented May 13, 2014 at 9:59
  • May be css not rendering in your page Commented May 13, 2014 at 10:08

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.