A
A
Alexander Sharomet2015-10-23 21:01:26
PHP
Alexander Sharomet, 2015-10-23 21:01:26

How should the path to css, js look like?

Hello. Such a question, does it matter what the link to the css file looks like?

<link href="http://site/styles/styles.css" rel="stylesheet">

With URL
or <link href="styles/styles.css" rel="stylesheet">
without URL
thanks.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Ashot Aslanyan, 2015-10-23
@sharomet

no url

I
Ivanq, 2015-10-23
@Ivanq

[IMHO mode on]
As for me, you do not need to specify the site address, but put / before the paths - yes. And yet - it seems to me that it would be more reasonable to name the folder with styles css, and with scripts - js.
[IMHO mode off]

I
Ilyusha Prokopiev, 2015-10-23
@iliapro

There is absolutely no difference. But when you develop a site on your local, you probably use a relative address (without a URL), so, for me, using a relative address looks more logical

V
Vanya Zyuzgin, 2015-10-24
@site2life

It's most likely a matter of habit. I write with url, I like it more from an aesthetic point of view. Changing such a url when transferring to a new domain is as easy as shelling pears. Most CMS have the ability to add the url automatically.
I also add a URL to all pictures and scripts on the site

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question