You should note that Wordpress has an standard way to add <script>s and <style>s to the <head> section of your web document, which is using wp_enqueue_scripts action, but regarding your question, I will try to provide the desired way:
You may put that particular CSS in <style> tags in your documents <head> section 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 let you have the desired output, I strongly recommend you do not use it, because you may use:
.portfolio {
background-attachment: fixed;
background-image: url("img/o-BUSINESS-TECHNOLOGY-facebook.jpg");
}
in your style.css file and still get the same result.
I really do not know what kind of dynamic CSS, are you after, but If you really want it to be dynamic and you are sure about what you are doing, you have two methods:
- The above method (adding styles to
<style> tag in <head> section of document)
- making your stylesheet file dynamic, using PHP (which you may get a tutorial on this link, or google for dynamic stylesheet php)