I am in the process of designing a new theme so I was looking through the theme.inc file and came across something that I do not really understand. Would appreciate if someone could explain.

In theme.inc these lines can be found

  // includes/theme.inc
  $output .= drupal_get_html_head();
  $output .= " <style type=\"text/css\" media=\"all\">";
  $output .= " @import url(misc/drupal.css);";
  $output .= " </style>";

but to me it seems like the last three lines duplicates what is in the grupal_get_html_head() function (below) but I do not really know what the importance of media=all is. What is it that I am missing?

// includes/common.inc
function drupal_get_html_head() {
  global $base_url;

  $output = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />";
  $output .= "<base href=\"$base_url/\" />\n";
  $output .= "<style type=\"text/css\">\n";
  $output .= "@import url(misc/drupal.css);\n";
  $output .= "</style>\n";

  return $output . drupal_set_html_head();


Gábor Hojtsy’s picture

Congratulations, you have found a bug!

Since the addition of drupal_get_html_head() is quite recent, this bug was not dicovered yet. Please open an issue in the issue tracker, and provide a diff if possible against the CVS version of the common.inc and theme.inc files. The media="all" is better moved into the common.inc code, it is needed to prevent Flash Of Unstyled Content (FUOC) in MSIE.

pz’s picture

Sorry still not able to make patches, but I have added it to the bugtracker.