Am trying to learn web development by creating a website my own instead learning every single theory written on a textbook.
Currently am trying to link a stylesheet and favicon on my root folder into the file called debian.html and debian-post-install.html. But it’s not working and I don’t know why.
code used inside both html files head section are,
<link rel="stylesheet" href="/styles/style.css" />
<link rel="icon" type="image/png" href="/images/favicon.png" />
To point to the root directory files or directories we use / in html instead of ../ right? Then why it’s not working.
Also I need advice on how bad is my html file structuring and what changes recommended.
Solution
<link rel="stylesheet" href="../../styles/style.css" />
<link rel="icon" type="image/png" href="../../images/favicon.png" />


no, they do not. (click for details)
those three do not always resolve to the same thing: the first and last are relative, while the second is absolute.
from a file at
http://example.com/index.html, all three would resolve tohttp://example.com/style.css.But from a file at
http://example.com/foo/index.htmlthehref="style.css"andhref="./style.css"will both resolve tohttp://example.com/foo/style.csswhilehref="/style.css"will continue to resolve to the file at the root (http://example.com/style.css).