Div style loop
-
I have an image I need to change inside a div according to each page. I have the following code but no images are showing up:
<div class="quicklink" title="read more..." style= <?php if(is_page('About')) { echo 'class="aboutquicklinksclass"'; } elseif(is_page('News')) { echo 'class="newsquicklinksclass"'; } // continue with elseif lines // else { echo 'class="normalquicklinksclass"'; } ?>>And the following CSS code:
.newsquicklinksclass { background: url (image.jpg) bottom left no-repeat; } .aboutquicklinksclass { background: url (image.jpg) bottom left no-repeat; } .normalquicklinksclass { background: url (image.jpg) bottom left no-repeat; }Any ideas what’s going on? Thanks.
The topic ‘Div style loop’ is closed to new replies.