diff --git field_example/field_example.module field_example/field_example.module
index bb183b1..c64b9e4 100644
--- field_example/field_example.module
+++ field_example/field_example.module
@@ -116,7 +116,23 @@ function field_example_field_formatter_view($entity_type, $entity, $field, $inst
     // This formatter simply outputs the field as text and with a color.
     case 'field_example_simple_text':
       foreach ($items as $delta => $item) {
-        $element[$delta]['#markup'] = '<p style="color: ' . $item['rgb'] . '">' . t('The color code in this field is @code', array('@code' => $item['rgb'])) . '</p>';
+        $element[$delta] = array(
+          // our desired HTML output is:
+          // <div style="color: #hexcolor">The color code is #hexcolor</div>
+          // we will make the equivalent as a renderable array.
+          // '#type' tells the theme system this is an HTML tag,
+          // '#tag' is the HTML tag,
+          // '#attributes' is an array of attributes to add to the
+          //   HTML tag,
+          // and finally '#value' is the content we're wrapping in this tag.
+          // See the API docs for theme_html_tag() for details.
+          '#type' => 'html_tag',
+          '#tag' => 'div',
+          '#attributes' => array(
+            'style' => 'color: ' . $item['rgb'],
+          ),
+          '#value' => t('The color code in this field is @code', array('@code' => $item['rgb'])),
+        );
       }
       break;
 
