1

I am theming a views exposed form which is a block. The views filters are displayed in a block and I am theming this using "views-exposed-form--view-name.tpl.php". I want to apply CSS to this template file.

How to do this.

  • 1
    you can write the styles in your main css file , why you are thinking to apply a css file to this template? – Anoop Joseph Nov 6 '12 at 10:57
  • @Anoop Joseph: I want to apply CSS to only this exposed form template. – Cindrella Nov 6 '12 at 10:59
  • 1
    @Mohini How do you mean? That's what CSS selectors are there for. – hampusn Nov 6 '12 at 11:12
  • 1
    You could probably add the CSS in <style>-tags on top of your template. Most browsers will probably understand what you want, it does result in ugly HTML though. You could also add the CSS in your main CSS file and use .view-id-viewname .div (etc.) to target elements specificaaly in that view – Neograph734 Nov 6 '12 at 11:13
  • @Neograph734: Didn't thought of applying <style> tags . Using style tags and its working fine. Thanks – Cindrella Nov 6 '12 at 12:19
1

You could add the CSS in <style> tags on top of your template. Most browsers will probably understand what you want, it does result in ugly HTML though.

You could also add the CSS in your main CSS file and use .view-id-viewname .div (etc.) to target elements specificaaly in that view

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.