controltheweb
asked on
Write CSS background filename from current page filename string
On a page this-is-the-filename.htm, I want the background of a style on the page to be this-is-the-filename.jpg. The image filename (without extension) needs to match the page filename (without extension),
alsadu.dreamhosters.com/fu rniture/fu rniture_te st.htm has embedded style
#pic a {
background: url('/furniture/images/Tru nk_test.jp g');
width: 320px; height:320px;
display: block; margin: 0; padding: 0; }
#pic a:hover {
background: url('/furniture/images/Tru nk_test.jp g') 0 -320px; }
The string Trunk_test.jpg is what I want to be furniture_test.jpg, taking "furniture_test" from the filename furniture_test.htm
alsadu.dreamhosters.com/fu
#pic a {
background: url('/furniture/images/Tru
width: 320px; height:320px;
display: block; margin: 0; padding: 0; }
#pic a:hover {
background: url('/furniture/images/Tru
The string Trunk_test.jpg is what I want to be furniture_test.jpg, taking "furniture_test" from the filename furniture_test.htm
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Zvonko's solution is almost exactly like the server side solution. You should try with that if you believe the site's users will have JavaScript.
- Joe P
- Joe P
ASKER