path url ( relative to what , syntax)

142 views
Skip to first unread message

lionelbg

unread,
Feb 10, 2015, 5:14:55 AM2/10/15
to blueg...@googlegroups.com
I don't know if there is a specification about url /path

1) for syntax should we write 
   src="./dir/file.css"
   src="/dir/file.css"
   src="dir/file.css"
It seem some html css3 editor don't support the 3 only a subset
since browser need to concat  relative path  does "./dir1/" + "/dir2/" is interpret like "./dir1/dir2/" not "./dir1//dir2"
some browser  seem be be "/" "\" agnostic
bluegriffon should support many syntax is this make sense   !!!

2) same for protocol when import /load in browser ( blue griffon is an browser )
  src="c://
  src="file://
  src="http "
It seem some html css3 browser don't support the 3 .....only 2. i think c:/  is a shortcut of file://

regard's

Joeg

unread,
Feb 11, 2015, 8:55:54 AM2/11/15
to blueg...@googlegroups.com
Paths are always relative to the location of the saved html file.

src="file.css" points to a style sheet file at the same directory level as the html file.
src="dir/file.css" points to a file inside a directory "dir" at the same directory level as the html file.
src="../dir/file.css" points to a file inside a directory "dir" one level up from the html file or ../../ two levels up etc

There is no need to use a leading slash "/dir1/" so concatenating "dir1/" + "dir2/" will give the correct result.

The forms "./dir/files.css" and "C://" are effectively hard-coding the paths to your local computer and are thus not going to be very useful on a web server.
Reply all
Reply to author
Forward
0 new messages