Custom CSS for title fields of Articles specified in content creation Custom CSS for title fields of Articles specified in content creation

As an example, I have a view that displays my latest 10 articles but want the titles to be different colours. I want these colours to be determined based on what I input at the content creation form, whether it be in a separate field or by defining/attaching a specific class to each new Article.

Is there a way to do this or a better solution to my problem available? Thanks in advance :)
For the simplest and quickest implementation I'd suggest you create a array in your THEME_preprocess_node(&amp;$vars) in  template.php:

&lt;?php
$vars['color_cls'] = array( 
    'red',
    'blue',
    'yellow'
);
?&gt;


Then you could simply randomly address those in your node.tpl.php and print them as a class in your node, something like this:

&lt;div class="node &lt;?= $color_cls[array_rand($color_cls)]; ?&gt;"&gt;


You could also make the color_cls array associative and give them, for example, priorities:

&lt;?php
$vars['color_cls'] = array( 
    'critical' =&gt; 'red',
    'important' =&gt; 'blue',
    'normal' =&gt; 'yellow'
);
?&gt;


And ofcourse, then you just style them with your CSS. I'm assuming you do know how to style the classes, so I'll leave out the CSS  bit.