how to get css "background-color" value from content types I have a custom type, and I want to set background-color of it,when end user choose the color in add content page,
        example :  set background-color : black 
, I want get this value from database, and set style in my theme.
how to do this?
Drupal 7

What you can do is have a field or just for an example a simple textfield and you can use hook_node_view() or template_preprocess_node() to get the color value and use drupal_add_css(). An example would be like:

OPTION 1 - Module layer

/**
 * Implements hook_node_view().
 */  
function YOURMODULE_node_view($node, $view_mode) {

  // We check if the user is viewing the node/page in it's full view
  if ($view_mode == 'full' &amp;&amp; $node-&gt;type == 'page') {

    $field = field_get_items('node', $node, 'field_background_color');

    // Check if the field has a value
    if ($field) {

      $color = field_view_value('node', $node, 'field_background_color', $field[0]);

      // We specify the type to inline and group so it would override any style.
      drupal_add_css("#main-wrapper { background: {$color['#markup']}; }", 
        array('type' =&gt; 'inline', 'group' =&gt; CSS_THEME)
      );
    }
  }
}


OPTION 2 - Theme layer

/**
 * Implements template_preprocess_node().
 */  
function YOURTHEME_preprocess_node(&amp;$variables) {

  // We check if the user is viewing the node/page in it's full view
  if ($variables['view_mode'] == 'full' &amp;&amp; $variables['type'] == 'article') {

    // Get the node object to be used later
    $node = node_load($variables['nid']);

    $field = field_get_items('node', $node, 'field_background_color');

    // Check if the field has a value
    if ($field) {

      $color = field_view_value('node', $node, 'field_background_color', $field[0]);

      // We specify the type to inline and group so it would override 
      drupal_add_css("#main-wrapper { background: {$color['#markup']}; }", 
        array('type' =&gt; 'inline', 'group' =&gt; CSS_THEME)
      );
    }
  }
}