简体   繁体   中英

bootstrap not working in laravel5

I followed this turotial as basic laravel learning. I executed composer require illuminate/html . To import bootstrap in my project, in 'providers', I added

 Illuminate\View\ViewServiceProvider::class,
 Illuminate\Html\HtmlServiceProvider::class,

And in alaises, i added

'Form'=> Illuminate\Html\FormFacade::class,
 'Html'=> Illuminate\Html\HtmlFacade::class,

But the bootstrap does not seem to be working.

{!! Form::open() !!}

    <div class="form-group">
            {!! Form::label("name : ", "Your name") !!}
            {!! Form::text("username", null, ["class"=>"form-control"]) !!}
        </div>

 {!! Form::close() !!}

The text field does not stretch to the width of page, as it is supposed to.

Any idea why is it so? or any other alternative solution ?

You need to include link to bootstrap in your html template file.

<!doctype html>
<html>
    <head>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    </head>
    <body>
        <div id = "container">
            @yield("content")
        </div>
    </body>
</html>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM