diff --git a/pullquote.css b/pullquote.css
index f5645a6..34bce3f 100644
--- a/pullquote.css
+++ b/pullquote.css
@@ -8,6 +8,7 @@
 }
 
 .pullquote-quote {
+  z-index:1;
   background: #E8E8E8;
   border: 1px solid #AAA;
   color: #333;
@@ -25,9 +26,9 @@
 }
 
 /* inserts quotation marks around pullquoted text */
-span.pullquote-quote:before {
+.pullquote-quote:before {
   content: open-quote;
 }
-span.pullquote-quote:after {
+.pullquote-quote:after {
   content: close-quote;
 }
diff --git a/pullquote.js b/pullquote.js
index dd9de41..b412422 100644
--- a/pullquote.js
+++ b/pullquote.js
@@ -5,13 +5,45 @@ Drupal.behaviors.pullquote = {
     $('.pullquote:not(.pullquote-processed)', context).each(function () {
       var $span = $(this).addClass('pullquote-processed');
       // May be extended later on. (simply add ',div')
-      var $parent = $span.parent('p');
+      var $parent = $span.parent();
       if ($parent.length) {
+        // In the case of a pullquote inside any of the above contained/nested elements
+        var $elements = ['LI','UL','OL','TD','TR','TBODY','TABLE'];
+        //set a flag. Should be we add the quote above the element of inside it?
+        // pos set to 0 will be inside, 1 will be above.
+        var pos = 0;
+        while( jQuery.inArray($parent.get(0).tagName, $elements ) > -1 ) {
+          pos = 1;
+          if ($parent.parent().get(0).tagName == 'DIV') {
+            break;
+          }
+          $parent = $parent.parent();
+        }
         // Apply conditional pullquote container styling.
         $parent.addClass('pullquote-container');
-        $span.clone()
-          .addClass('pullquote-quote')
-          .prependTo($parent);
+        $text = $span.text();
+        if (pos == 0 && $parent.get(0).tagName == 'BLOCKQUOTE') {
+          //Blockquote is a special case. To have valid HTML you can't have inline
+          // level elements in the blockquote. They must be block level elements so
+          // we'll use a div here instead.
+          $span.clone()
+            .replaceWith('<div class="pullquote-processed">' + $text + '</div>')
+            .addClass('pullquote-quote')
+            .prependTo($parent);
+        }
+        else if (pos == 0) {
+          $span.clone()
+            .replaceWith('<span class="pullquote-processed">' + $text + '</span>')
+            .addClass('pullquote-quote')
+            .prependTo($parent);
+
+        }
+        else {
+          $second = $span.clone()
+            .replaceWith('<span class="pullquote-processed">' + $text + '</span>')
+            .addClass('pullquote-quote');
+          $parent.before($second);
+        }
       }
     });
   }
