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.

6
  • 1
    you can write the styles in your main css file , why you are thinking to apply a css file to this template? Commented Nov 6, 2012 at 10:57
  • @Anoop Joseph: I want to apply CSS to only this exposed form template.
    – Cindrella
    Commented Nov 6, 2012 at 10:59
  • 1
    @Mohini How do you mean? That's what CSS selectors are there for.
    – hampusn
    Commented Nov 6, 2012 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 Commented Nov 6, 2012 at 11:13
  • @Neograph734: Didn't thought of applying <style> tags . Using style tags and its working fine. Thanks
    – Cindrella
    Commented Nov 6, 2012 at 12:19

1 Answer 1

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 and acknowledge you have read our privacy policy.

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