link css with path

Solutions on MaxInterview for link css with path by the best coders in the world

showing results for - "link css with path"
Montserrat
04 Apr 2016
1/*Typical link CSS code: */
2<link rel="stylesheet" href="myStyles.css" type="text/css" />
3/*
4Absolute: 
5The browser will always interpret / as the root of the hostname. 
6For example, if my site was http://google.com/ and I specified /css/images.css 
7then it would search for that at http://google.com/css/images.css. 
8If your project root was actually at /myproject/ it would not find the css file.
9Therefore, you need to determine where your project folder root is relative 
10to the hostname, and specify that in your href notation.
11
12Relative:
13If you want to reference something you know is in the same path on the 
14url - that is, if it is in the same folder, 
15for example http://mysite.com/myUrlPath/index.html and 
16http://mysite.com/myUrlPath/css/style.css, and you know that it will always 
17be this way, you can go against convention and specify a relative path 
18by not putting a leading / in front of your path, for example, css/style.css.
19
20Filesystem Notations: 
21Additionally, you can use standard filesystem notations 
22like ... If you do http://google.com/images/../images/../images/myImage.png 
23it would be the same as http://google.com/images/myImage.png. If you want 
24to reference something that is one directory up from your file, 
25use ../myFile.css.
26*/