php - Bootstrap 在 laravel5 中不起作用

标签 php css html twitter-bootstrap

我关注了this turotial作为 Laravel 基础学习。我执行了composer require说明/html。为了在我的元素中导入 Bootstrap ,在“providers”中,我添加了

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

另外,我补充说

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

但是 Bootstrap 似乎不起作用。

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

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

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

文本字段没有像预期的那样拉伸(stretch)到页面宽度。

知道为什么会这样吗?或任何其他替代解决方案?

最佳答案

您需要在 html 模板文件中包含 Bootstrap 的链接。

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

关于php - Bootstrap 在 laravel5 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32695987/

相关文章:

php - 如何在 PHP 中缓存非常动态的网站?

css - 如何连续放置内容并防止 react native 溢出?

为每个值显示不同图像的 javascript slider

javascript - 进度条动画不起作用

html - IE 中页面顶部的背景图像,而不是背景

javascript - 编辑多个 html 文件 - 添加字符串到 <head>

html - 使用 bootstrap 在一行中定位 2 个元素

php - 无法将我当前的菜单转换为 Bootstrap 菜单

php - 如何合并到数据库

php - 将 Css 类添加到 PHP Wordpress 中的特定 div