A
A
Alexey2017-01-11 02:22:11
css
Alexey, 2017-01-11 02:22:11

On OpenServer the site opens and on the server does not connect the css file?

I spread the site on the server and there are no styles. Maybe an encoding problem. I tried to change the encoding in Notepad ++ and Sublome Text, it doesn’t help
The problem is in Google Chrome, I just don’t know which one
In other browsers, everything opens and works fine

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rob1n Bobin, 2017-01-11
@sp1rob

The problem is in the ways - 100%

M
Maxim, 2017-01-11
@m77x

do not confuse absolute paths with relative paths. For the server, the absolute path from the root folder [preceded by a slash "/"] for a relative path from the current file.
When you run even the html file in the address bar may be D:\...OS\OpenServer\domains\bb3.pk\index.html
or maybe http://bb3.pk
In the first case, the absolute path will not work, but in the second it will connect.
The relative path will work in both the first and second cases.

A
Anton Tikhomirov, 2017-01-19
@Acuna

Ctrl + U in Chrome, in the code, see what URL is written in the <style> tag, click on the link right there and see if the file itself exists. This is if the path is absolute. If relative, then you will have to figure out for yourself whether it lies in the right place. If the path is specified, for example, css/style.css, this means that this file must be located in the C:\OpenServer\domains\website\css\style.css folder. That is, any relative path sees everything from the root folder of the site.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question