doubledee Posted November 20, 2011 Share Posted November 20, 2011 When I have HTML like this... <!-- Page Stylesheets --> <link type="text/css" rel="stylesheet" href="/css/_main.css" /> ...should I use an Absolute Reference to the WebRoot (/css) or a Relative Reference (../css) ?? Debbie Quote Link to comment https://forums.phpfreaks.com/topic/251465-absolute-vs-relative-reference/ Share on other sites More sharing options...
sunfighter Posted November 20, 2011 Share Posted November 20, 2011 Using a relative reference has always been the recommended way to go. The reason being that the site could be picked up and moved without having things break. Now HTML has a tag called BASE, this sets the first part of a call that, for one reason or another, needed to be absolutely referenced. I set <base> when I grab a site's programming so I can view the images that are relative referenced in WAMP. Quote Link to comment https://forums.phpfreaks.com/topic/251465-absolute-vs-relative-reference/#findComment-1289750 Share on other sites More sharing options...
Gighalen Posted November 21, 2011 Share Posted November 21, 2011 relative ;-) Quote Link to comment https://forums.phpfreaks.com/topic/251465-absolute-vs-relative-reference/#findComment-1290153 Share on other sites More sharing options...
floridaflatlander Posted November 21, 2011 Share Posted November 21, 2011 I always thought absolute was something like http://www.mywebsite.com/folder/xxx.css and relative was ../xxx.css. If you can get away with relative thats the way to go. Quote Link to comment https://forums.phpfreaks.com/topic/251465-absolute-vs-relative-reference/#findComment-1290202 Share on other sites More sharing options...
requinix Posted November 22, 2011 Share Posted November 22, 2011 I always thought absolute was something like http://www.mywebsite.com/folder/xxx.css and relative was ../xxx.css. There are a few forms of absolute: http://www.example.com/folder/foo.bar (fully qualified) //www.example.com/folder/foo.bar (authority, no scheme*) /folder/foo.bar (path, no authority) * For some reason I'm not sure if this one is supported by the standards. Read otherwise somewhere? Regardless, it works. Quote Link to comment https://forums.phpfreaks.com/topic/251465-absolute-vs-relative-reference/#findComment-1290233 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.