Rectangle 27 0

Page specific CSS in Volusion with Javascript?


<div id="if_not_homepage">
    <link rel="stylesheet" href="/v/vspfiles/templates/YOUR_TEMPLATE/css/inner_style.css" />
</div>

Alternately, there is a div with an id of "if_homepage" that is read only if the user is on the default.asp (opposite of "if_not_homepage").

If you place the stylesheet within the directory "/v/vspfiles/templates/YOUR_TEMPLATE/css/" you'll be able to edit the stylesheet from within the File Editor in the Volusion dashboard as well (like your other stylesheets).

In between the <body> tags you'll just add a div with an id of "if_not_homepage" and the site will only read the contents of this div if not on the default.asp page. For example:

OR you could call a separate stylesheet completely from within this div (for example):

On a completely separate note, in your code above, you are missing either a class (.) or id (#) selector on 'content' in your CSS, so that may have something to do with it as well.

There's a much simpler way to do this in Volusion without Javascript. If you log in to your dashboard, go to 'Design->File Editor" and then click on the template HTML file (it will be under the heading 'Template Files', you'll be in the main template file for your site.

Note
Rectangle 27 0

Page specific CSS in Volusion with Javascript?


Instead of a style tag, I think you are better off setting the style directly with jQuery (if the DOM is loaded) or writing out a link tag to a separate style sheet.

Note