JGeorgeJ
JGeorgeJ

Reputation: 373

Laravel 5.6 unable to import css file

I am trying to import css file but i just cant.

my css file is in "public/css/style.css"

i ve tried all possible combinations that i found on internet but nothing works

<link href="/css/style.css" rel="stylesheet">
<link href="{!! asset('css/style.css') !!}" media="all" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="{{ URL::asset('css/style.css') }}" />

Laravel .htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

but nothing just works for me

Upvotes: 0

Views: 1971

Answers (3)

JGeorgeJ
JGeorgeJ

Reputation: 373

Solved

i ma probably missing some configuration that i cant find out. But i create virtual host with xampp and set DocumentRoot "C:\xampp\htdocs\final\public" and this works.

Thanks for help guys.

Upvotes: 1

Mahbod_SN
Mahbod_SN

Reputation: 61

<link href="{!! asset('css/style.css') !!}" media="all" rel="stylesheet" type="text/css" />

Change That to This

<link href="{{ asset('css/style.css') }}" media="all" rel="stylesheet" type="text/css" />

and it should work.

Upvotes: 2

matthunterking
matthunterking

Reputation: 1

Try:

<link href="./public/css/style.css" rel="stylesheet">

The ./ part is the current folder you are in.

Upvotes: 0

Related Questions