May 16, 200917 yr I need to define an image in a stylesheet. Here is a snippet of the HTML: <div class = 'systemLogo'></div> and here is a snippet of the stylesheet: .systemLogo { margin-left: 200px; margin-bottom: 20px; width: 780px; } .systemLogo:before { content: url(http://localhost:8080/qtiv2/images/JAssess.gif); } This works fine, but is not portable. If my stylesheet code is: .systemLogo:before { content: url(images/JAssess.gif); } This does not work, even though the <head> tag of the HTML is: <base href='http://localhost:8080/qtiv2/' /> In other words, the base href is not being added to the url for the image. Perhaps this is something which CSS cannot do: but it is a nuisance if one wishes to write portable CSS Any ideas, anyone?
May 16, 200917 yr the base reference is only a reference for files linked directly from the html file, it's effect does not apply to any other external filetypes such as php or css. So you'll have to use ../
Create an account or sign in to comment