为什么引导程序在我的laravel主页中不起作用?

时间:2020-09-09 06:55:10

标签: laravel vue.js bootstrap-4

到目前为止我做了什么

首先,我在Laravel真的很新。我正在YouTube上观看精彩的教程,并按照大多数说明进行操作。我将项目上传到我的域中,因为我想尝试一下数据库连接在生产环境中如何使用MySql进行工作(该视频中的人使用sqlite)。 即使我设法使项目按预期方式工作,但是当我打开页面时,它看起来并不正常,屏幕越小,看起来越糟,您仍然可以侧向移动(这确实很可怕)。

它曾经可以正常工作

例如,当我从托管服务商创建一个空白的laravel项目时,例如,我用手机对其进行了访问,它运行良好,并且我的意思是说“ Laravel”的字体有边距,并且所有内容看起来都居中并且像一个应该会看到一个引导页面。在按照教程创建了一个项目并将其上传后,噩梦就开始了。


向您显示代码

基本的laravel项目说“ Laravel”,而我的项目说“ gastiGram”(被注释为“……这是问题!!”);也许用较少的字母就可以在移动设备上很好地工作(当然,我在开玩笑,我一定在某个地方搞砸了)。这是代码,伙计们和女孩,所以也许您可以帮帮我。谢谢。

welcome.blade.php

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>gastiGram</title>

        <!-- Fonts -->
        <link href="https://fonts.googleapis.com/css?family=Nunito:200,600" rel="stylesheet">

        <!-- Styles -->
        <style>
            html, body {
                background-color: #fff;
                color: #636b6f;
                font-family: 'Nunito', sans-serif;
                font-weight: 200;
                height: 100vh;
                margin: 0;
            }

            .full-height {
                height: 100vh;
            }

            .flex-center {
                align-items: center;
                display: flex;
                justify-content: center;
            }

            .position-ref {
                position: relative;
            }

            .top-right {
                position: absolute;
                right: 10px;
                top: 18px;
            }

            .content {
                text-align: center;
            }

            .title {
                font-size: 84px;
            }

            .links > a {
                color: #636b6f;
                padding: 0 25px;
                font-size: 13px;
                font-weight: 600;
                letter-spacing: .1rem;
                text-decoration: none;
                text-transform: uppercase;
            }

            .m-b-md {
                margin-bottom: 30px;
            }
        </style>
    </head>
    <body>
        <div class="flex-center position-ref full-height">

            @if (Route::has('login'))
                <div class="top-right links">
                    @auth
                        <a href="{{ url('/home') }}">Home</a>
                    @else
                        <a href="{{ route('login') }}">Login</a>

                        @if (Route::has('register'))
                            <a href="{{ route('register') }}">Register</a>
                        @endif
                    @endauth
                </div>
            @endif

            <div class="content">
                <div class="title m-b-md">
                    gastiGram <!-- ¡¡¡HERE IS THE PROBLEM!!! -->
                </div>
                <div class="navbar-brand">
                    <div>

                    </div>
                </div>

                <div class="links">
                    <a href="https://laravel.com/docs">Docs</a>
                    <a href="https://laracasts.com">Laracasts</a>
                    <a href="https://laravel-news.com">News</a>
                    <a href="https://blog.laravel.com">Blog</a>
                    <a href="https://nova.laravel.com">Nova</a>
                    <a href="https://forge.laravel.com">Forge</a>
                    <a href="https://vapor.laravel.com">Vapor</a>
                    <a href="https://github.com/laravel/laravel">GitHub</a>
                </div>
            </div>
        </div>
    </body>
</html>

2 个答案:

答案 0 :(得分:1)

似乎没有人为我找到答案...

我尝试了别人说的话,得出的结论是,引导和验证都不是问题。我想这是事实,contenttitle m-b-md类没有提供我期望的文本期望的响应能力

 <div class="content">
    <div class="title m-b-md">
        gastiGram <!-- ¡¡¡HERE IS WHERE THE PROBLEM WAS!!! -->
    </div>
    <div class="navbar-brand">
        <div>

        </div>
    </div>

    <div class="links">
        <a href="https://laravel.com/docs">Docs</a>
        <a href="https://laracasts.com">Laracasts</a>
        <a href="https://laravel-news.com">News</a>
        <a href="https://blog.laravel.com">Blog</a>
        <a href="https://nova.laravel.com">Nova</a>
        <a href="https://forge.laravel.com">Forge</a>
        <a href="https://vapor.laravel.com">Vapor</a>
        <a href="https://github.com/laravel/laravel">GitHub</a>
    </div>
</div>

我愿意接受一个答案,该答案表明我在说的是错误的,我可以在该项目中对我的问题应用其他解决方案。 Kamlesh Paul的建议对我很有用……现在,我对laravel的工作方式有了一些更好的了解。仍然不够用,因为字体在横向折叠时应用了他说的方法,但是没有用,所以我只是手动应用了样式

<h1 style="font-size:20vw;">gastiGram</h1>

答案 1 :(得分:0)

 <link href="{{asset('css/app.css')}}" rel="stylesheet">

我解决了将此代码放置在welcome.blade.php页面的开头部分的问题。

相关问题