0

So im using template that is using internal css, and im going to move the css so it will be external css

this is my head script

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Bootstrap CRUD Data Table for Database with Modal Form</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="./styles.css">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>

</head>

im unable to use <link rel="stylesheet" href="./styles.css">, and its not underlined in my VScode.

and this is my folder structure

enter image description here

Tsabit
  • 77
  • 8
  • Why are you unable? Anything not working when you place that line in your markup? Does that file exist? – Nico Haase Jun 12 '23 at 05:38
  • 1
    Could you place a small screenshot of your file/folder structure – naveen Jun 12 '23 at 05:47
  • @naveen im edited my question and there is my folder structure – Tsabit Jun 12 '23 at 08:16
  • 1
    _"and this is my folder structure"_ - what you are showing us there is a template file, so likely that does not get requested directly? What _URL_ are you actually using on the client side to request the page? – CBroe Jun 12 '23 at 08:21
  • Looks like Laravel? Please edit your tag and name the PHP framework you are using. It will give more visibility to the laravel experts. Also elaborate a bit more. I thought it was just `html/css` – naveen Jun 12 '23 at 11:45

2 Answers2

1

A simple HTTP server will map URLs directly onto the filesystem. So if you ask for http://example.com/foo/bar.html it will look for a file at C:\my webserver/web root/foo/bar.html.

You have placed your stylesheet in a directory named views. This implies you are using some kind of framework which doesn't operate so simply. Typically it will use the front controller pattern and do things like placing the main content of a page in views and then wrapping it with standard headers and footers from a layout.

Systems like this aren't designed to handle stylesheets placed in views. You need to figure out how your system expects static files to be handled (commonly they are placed in a directory called static or public) and how to determine the URL for them.

The documentation for the framework you are using would be a good place to start.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
0

Check the relative path of the css file . If you want to move one directory up then use ../ or if you want to locate the file in current directory then use ./