Home > PHP Framework > Laravel > How to import css files in laravel

How to import css files in laravel

青灯夜游
Release: 2023-01-13 00:40:29
Original
4387 people have browsed it

How to introduce css files in laravel: 1. Put the CSS files in the public directory; 2. Use the link tag in the required project file to introduce the syntax "".

How to import css files in laravel

The operating environment of this tutorial: Windows 7 system, Laravel version 5, Dell G3 computer.

Laravel starts from public by default, so the static files are placed under public to start. You only need to put the css file you want to load into the public folder. Here I use layui as an example:

Just load it in the project file:

<link rel="stylesheet" href="{{URL::asset(&#39;layui-v2.5.4/layui/css/layui.css&#39;)}}">
Copy after login

If you want Introducing js files is a similar approach. Put the js files into the public folder and load them in the project file:

<script type="text/javascript" src="{{ URL::asset(&#39;layui-v2.5.4/layui/layui.js&#39;) }}"></script>
Copy after login

Related recommendations: The latest five Laravel video tutorials

The above is the detailed content of How to import css files in laravel. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template