dounuo1881
2017-11-18 19:37
浏览 144
已采纳

Laravel在php页面上显示css效果

I tried a lot before asking this question here.

I am working on an android project called 5.2 that has a folder called CSS under public folder which contains css.css file. So the path of casacding style sheet file is :

5.2\public\CSS\css.css.

And I have a folder called Gordon which contains index.php.

the path is 5.2esources\views\Gordon\index.php

My problem css effects is not show.

index.php file.

     <html>
     <head>

     <title>
     </title>
     </head>
     <body>
     <?php

    {{ echo '<link href="{{ asset(CSS/css.css) }}" rel="stylesheet">'; 
    echo '<div class="one"> '; 
    echo ' Hello CSS  ';  
    echo '</div>' ;  }}
     ?>
    </body>
    </html>

css.css file

.one
{
color:red;
font-type:bold;
}
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongzhuang1923 2017-11-18 19:40
    已采纳

    Off the top of my head...

    Rename file index.blade.php

    To use blade and rewrite the code as:

    <html>
    
    <head>
    
      <title>
      </title>
    </head>
    
     <body>
    
    <link href="{{ asset('CSS/css.css') }}" rel="stylesheet">  
    <div class="one">
    Hello CSS
     </div> 
     </body>
    
    </html>
    

    You don't need the PHP tags because blade doesn't require them and blade syntax doesn't use echo if I remember correctly.

    点赞 评论

相关推荐 更多相似问题