HTML how to link CSS in another directory? -


the structure of current public_html follows: my css in "css" directory, while php/html in "register" directory.

snippet:

<link rel="stylesheet" type="text/css" href="/css/main.css">

the html in "register" directory.

any help?

to go 1 directory type

../

so in case solution simply:

<link rel="stylesheet" type="text/css" href="../css/main.css">


you can link stylesheet absolutely:

<link rel="stylesheet" type="text/css" href="http://example.com/main.css" />

or

<link rel="stylesheet" type="text/css" href="/main.css" />

or using base href ~:

<base href="http://example.com/" />

<link rel="stylesheet" type="text/css" href="main.css" />


Comments