diff --git a/src/wp-includes/class.wp-styles.php b/src/wp-includes/class.wp-styles.php
old mode 100644
new mode 100755
index eb16067..1140418
--- a/src/wp-includes/class.wp-styles.php
+++ b/src/wp-includes/class.wp-styles.php
@@ -89,6 +89,16 @@ class WP_Styles extends WP_Dependencies {
 		 * @param string $handle The style's registered handle.
 		 */
 		$tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-css' $title href='$href' type='text/css' media='$media' />\n", $handle );
+
+		// Add stylesheet outside the <head>, HTML4 and HTML5 have different specs.
+		if ( isset($obj->extra['in_footer']) ) { 
+			if ( current_theme_supports('html5') ) {
+				$tag = apply_filters( 'style_loader_tag', "<link rel='$rel' id='$handle-css' $title href='$href' property='$handle-css-$rel' type='text/css' media='$media' />\n", $handle );
+			}else{
+				$tag = "<style id='$handle-css' type='text/css' media='$media'>@import url('$href')</style>\n";
+			}
+		}
+
 		if ( 'rtl' === $this->text_direction && isset($obj->extra['rtl']) && $obj->extra['rtl'] ) {
 			if ( is_bool( $obj->extra['rtl'] ) || 'replace' === $obj->extra['rtl'] ) {
 				$suffix = isset( $obj->extra['suffix'] ) ? $obj->extra['suffix'] : '';
@@ -227,7 +237,14 @@ class WP_Styles extends WP_Dependencies {
 		return false;
 	}
 
-	public function do_footer_items() { // HTML 5 allows styles in the body, grab late enqueued items and output them in the footer.
+	public function do_footer_items() {
+		$footer_items = array_diff($this->queue, $this->done);
+		if ( ! empty( $footer_items ) ) {
+			foreach ( $footer_items as $footer_item ) {
+				$this->registered[$footer_item]->extra['in_footer'] = true;
+			}
+		}
+
 		$this->do_items(false, 1);
 		return $this->done;
 	}
