Home > Back-end >  Why Custom CSS file doesn't work anymore?
Why Custom CSS file doesn't work anymore?

Time:10-04

I'm building an eCommerce website using PHP, Bootstrap, and Jquery. I created this header file like this:

<!DOCTYPE html>
<html>
   <head>
       <meta charset="UTF-8">
       <meta http-equiv="X-UA-Compatible" content="IE=edge">
       <meta name="viewport" content="width=device-width, initial-scale=1.0">
       <title><?php getTitle() ?></title>
       <!-- FONTAWESOME CDN -->
       <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta2/css/all.min.css" integrity="sha512-YWzhKL2whUzgiheMoBFwW8CKV4qpHQAEuvilg9FAn5VJUDwKZZxkJNuGM4XkWuk94WCrrwslk8yWNGmY1EduTA==" crossorigin="anonymous" referrerpolicy="no-referrer"/>
       <!-- BOOTSTRAP CDN -->
       <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous"/>
       <!-- CUSTOM CSS -->
       <link rel="stylesheet" href="/includes/templates/index.css"/>
   </head>
   <body>

Then I created the custom CSS file as you can see above. This file works with me on the login page. But now every time I want to custom something on bootstrap or just adding custom CSS, it doesn't work anymore. PS: the path is true.

CodePudding user response:

no need to use "/" for path to CSS, so you can write like this

<link rel="stylesheet" href="includes/templates/index.css"/>

CodePudding user response:

Custom CSS Link: <link rel="stylesheet" href="includes/templates/index.css"/>

CodePudding user response:

The problem can comes from PHP error when he tries to execute the function getTitle() he found a problem so that the navigator will not read the next lines after <title> tag. So that, try to remove it from the title tag <title></title> to make sure that the problem is not that.

  • Related