It should be noted that Wordpress has a standard way of adding <script> and <style> to the <head> section of your web document, which uses the wp_enqueue_scripts action, but regarding your question, I will try to provide the desired way:
You can put this particular CSS in the <style> tags in your <head> documents and use:
.portfolio { background-attachment: fixed; background-image: url("<?php echo get_template_directory_uri(); ?>/img/o-BUSINESS-TECHNOLOGY-facebook.jpg"); }
UPDATE
Although this seems to work and gives you the desired result, I highly recommend that you not use it, because you can use:
.portfolio { background-attachment: fixed; background-image: url("img/o-BUSINESS-TECHNOLOGY-facebook.jpg"); }
in your style.css file and get the same result.
I really don't know what dynamic CSS you are after, but if you really want it to be dynamic and you are sure what you are doing, you have two methods:
- The above method (adding styles to the
<style> in the <head> section of the document) - creating a dynamic stylesheet using PHP (where you can get a tutorial from this link or google for a dynamic php style sheet )
source share