I cannot find bootstrap.css in my folders - php

I can't find the path for my CSS documents.
My bootstrap.css is located at https://i.hizliresim.com/P7kRGO.jpg and here is the error message I get: https://i.hizliresim.com/7BgOQN.jpg
<link href="https://fonts.googleapis.com/css?family=Encode+Sans+Expanded:400,600,700" rel="stylesheet">
<!-- Stylesheets -->
<link href=./plugin-frameworks\bootstrap.css" rel="stylesheet">
<link href="../views/plugin-frameworks/bootstrap.css"rel="stylesheet">
<link href="./fonts/ionicons.css" rel="stylesheet">
<link href="/common/styles.css" rel="stylesheet">
I'm using PHP 7, Laravel 5.4, and running on xampp Apache.

Use asset helper like this to link a resource in public directory:
<link rel="stylesheet" href="{{asset('styles/main.css')}}">

Related

Why I am getting Refused to apply style from css because its MIME type ('text/html') is not a supported

I have a laravel app
I am externally adding css files to my project
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4//owl.carousel.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4//owl.theme.default.min.css">
I deployed the laravel app to heroku
I get the following error
Refused to apply style from 'https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4//owl.carousel.min.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
Any reason
Thanks
URL is wrong
try
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css">

I can´t link Bootstrap 4.1.0 to my Laravel project

I´m trying to link bootstrap css to my Laravel proyect using
or in my view but it not working.
In scss class I tried this:
#import 'node_modules/bootstrap/scss/bootstrap' or #import '~bootstrap/scss/bootstrap';
In view class I tried this:
<!--<link rel="stylesheet" type="text/css" href="css/app.css"/>-->
or <link rel="stylesheet" type="text/css" href="{{url('css/app.css')}}"/>
My scss class looks like this:
#import url('https://fonts.googleapis.com/css?family=Nunito');
#import 'variables';
#import '~bootstrap/scss/bootstrap';
//#import 'node_modules/bootstrap/scss/bootstrap';
#import 'custom';
They show any errors, but it don´t load the bootstrap styles
First of all, you'll to go to your prompt and type
npm install bootstrap#4.1.0
Then, in your bootstrap.js file, inside the try statement, type this:
require ('bootstrap');
In your app.scss file
#import '~bootstrap/scss/bootstrap';
Run:
npm run dev
In your view
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<script src="{{ asset('js/app.js') }}"></script>
looking at your description, you only need to run npm dev
npm run dev
and add in any .blade.php file
in head tag:
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
in body tag:
<script src="{{ asset('js/app.js') }}"></script>

How to access files of public folder in Laravel and Linux OS

Linux can't find the css, js etc. files which are placed in public folder.
I am using this code to access my files:
<link rel="stylesheet" href="{{ URL::to('css/styles.css') }}">
And it is giving an error like this:
But on windows exactly the same project is working fine.
Please help me to solve this problem.
Create the symbolic link by executing: php artisan storage:link
you can use this will be execute. no need to url facade.
<link rel="stylesheet" href="css/app.css">
<link rel="stylesheet" href="{{ asset('css/styles.css') }}">

Symfony the right way assets path

I am trying to find out, how to get path of my css and js files.
This is my base.html.twig in app/Resources/views/base.html.twig
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>{% block title %}Welcome!{% endblock %}</title>
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap-theme.min.css">
</head>
<body>
{% block body %}{% endblock %}
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
It cant find my assets, because it is seeking in web/ directory by default. How should my path look like to find the files in app/Resources/views?
thanks!
Try to include stylesheet as below :
{% stylesheets 'css/bootstrap.min.css'
'css/bootstrap-theme.min.css'
filter='cssrewrite' %}
{% enstylesheets %}
Also you should install assets and you can use symlink option to assets:install command. This will make symlink in web folder to your bundle public folders
app/console assets:install --symlink
Without symlink option this task makes copy of files, so your changes doesn't affect.
You should also use assetic:dump command
app/console assetic:dump
Clear the cache as well.

Forms in PHP not displaying

Using this exact code I've been able to create text fields in HTML, but when I convert (rename) the file to PHP the field dissapears. Why does this happen and how do I stop it?
Code:
<!DOCTYPE html>
<html>
<head>
<title>StatsCalc V1</title>
<link rel="stylesheet" type="text/css" href="Buttons.css">
<link rel="icon" type="image/png" href="favicon.ico">
<link href='http://fonts.googleapis.com/css?family=Raleway:500' rel='stylesheet' type='text/css'>
</head>
<body>
<form>
<input type="text" class="writies" name="writy1" />
</form>
</body>
</html>
make a new file index.php write in it the bellow code and if it shows something you have php installed if not you don't have.
To have php installed you either install manually apache + php or you download a ready made application like xampp or ampps or easyphp which will provide you with everything you need to begin learning php.
tutorial for install of course you can choose any other.
<?php
phpinfo();

Categories