How to add css to specific blocks or view with CSS injector module?

I can add css to specific pages, but what about blocks, views and all sorts of other nodes?

enter image description here


I am try already this but i think it would be helpfull

Use php section to add css against any view or block and try this one

if ( $block->module == 'your_block_id/name'){
          //add some code here

Or can do it by add a class in view or block


Using the CSS Injector module, there is not a way to only add CSS to pages that include specific elements such as Views, blocks, etc.

However, that's generally OK. If you're using Drupal's built-in CSS aggregation (and/or Advanced Aggregation), you're really just looking at couple hundred bytes per page, which should be cached by the browser, making those tweaks fairly negligible in terms of page load times.

  • Sorry but I dont' understand that answer at all...so this CAN'T be done? Mar 16 '16 at 3:27

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.