Replies: 10   Views: 4405
Embedhtml with wordstyles on inline elements
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by mguillermin  · 04-10-2013 - 12:22


I don't manage to correctly set a specific word style on a inline element (a <span> in my case).

Here is an extract from my code : 

$docx = new CreateDocx($myTemplate);

$content = '<p><span class="marker">test</span></p>';

$wordStyles = array(

  '.marker' => 'Highlight'


$docx->embedHTML($content, array(

  'strictWordStyles' => true,

  'wordStyles' => $wordStyles,



The "Highlight" style is defined in my template (it's a character style), but it is not applied by PHPDocx on my "test" content.

Do you know how to achieve that ?