[css-d] base href and CSS
I am having trouble with using the tag base href= / in my html and it not being translated into my CSS document. I have declared - base href=http://www.foo.com/bar/; / in my html head (and above the CSS declaration). The physical location of the CSS file is /assets/css/styles.css In my CSS file, I have element styles like this-- background: url(/images/foo.gif); /* this doesn't work */ background: url(images/foo.gif); /* nor does this */ If I manually change the above path to ../../images/foo.gif then it works fine, but shouldn't the CSS file be using the base href I declared? Thanks, Marty Martin __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] base href and CSS
Not all browsers apply base to linked CSS files so it's best to just not bother using it. Alex Cole Date: Mon, 27 Oct 2008 11:31:29 -0400 From: [EMAIL PROTECTED] To: css-d@lists.css-discuss.org Subject: [css-d] base href and CSS I am having trouble with using the tag base href= / in my html and it not being translated into my CSS document. I have declared - base href=http://www.foo.com/bar/; / in my html head (and above the CSS declaration). The physical location of the CSS file is /assets/css/styles.css In my CSS file, I have element styles like this-- background: url(/images/foo.gif); /* this doesn't work */ background: url(images/foo.gif); /* nor does this */ If I manually change the above path to ../../images/foo.gif then it works fine, but shouldn't the CSS file be using the base href I declared? Thanks, Marty Martin __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ _ Discover Bird's Eye View now with Multimap from Live Search http://clk.atdmt.com/UKM/go/111354026/direct/01/ __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] base href and CSS
When I go here... http://www.foo.com/bar/ it says Sorry, Page not found. Here are other Searches Services What is the base reference for the domain... it looks like its here.. http://www.foo.com/ Kelly Sigethy - Frynge.com Web Design - Hosting - Advertising http://www.frynge.com 1-403-251-9486 (Calgary) 1-866-331-9684 (Toll Free - Canada and the USA) +44 (0)8717 206 505 (United Kingdom) - Original Message - From: Marty Martin [EMAIL PROTECTED] To: css-d@lists.css-discuss.org Sent: Monday, October 27, 2008 9:31 AM Subject: [css-d] base href and CSS I am having trouble with using the tag base href= / in my html and it not being translated into my CSS document. I have declared - base href=http://www.foo.com/bar/; / in my html head (and above the CSS declaration). The physical location of the CSS file is /assets/css/styles.css In my CSS file, I have element styles like this-- background: url(/images/foo.gif); /* this doesn't work */ background: url(images/foo.gif); /* nor does this */ If I manually change the above path to ../../images/foo.gif then it works fine, but shouldn't the CSS file be using the base href I declared? Thanks, Marty Martin __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/ __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] base href and CSS
2008/10/27 Marty Martin [EMAIL PROTECTED]: I am having trouble with using the tag base href= / in my html and it not being translated into my CSS document. snip ... shouldn't the CSS file be using the base href I declared? No. The base element changes the base URI for the HTML document, not associated stylesheets (except, I think, in Netscape 4, buggiest browser of them all). I prefer to avoid the base element and use root relative URIs (ones which start with a / character) for everything except document specific resources. -- David Dorward http://dorward.me.ukhttp://blog.dorward.me.uk __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/