0

I need to load a couple styles on one specific page.

The problem lies in the CMS I'm using
I can't change the class to the div and make it specific so I can add styles to it and I also can't add specific styles to the page itself. It all has to be done in the main style sheet.
I know you can use conditional CSS depending on the browser but...

Can you load styles based on what page you are on?
So if blank.html then load these 2 styles?

2
  • If you don't have php access to add an if clause or permission to add a jquery you could try an htaccess trick. Commented Sep 22, 2014 at 19:17
  • Is there no class attribute that specifies the page e.g. in body tag page-id-8 or similar? Commented Sep 22, 2014 at 19:18

1 Answer 1

1

Yes, you could use the CSS @document at-rule, but only in Firefox under the @-moz-document prefix. See https://developer.mozilla.org/en-US/docs/Web/CSS/@document.

Sign up to request clarification or add additional context in comments.

2 Comments

This is experimental technology and only supported by Firefox. I wouldn't recommend using it.
Nice, I'd never heard of that until now! Have ten of the finest imaginary internet points! (Obviously with awareness of the cross-browser problems…)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.