Hello,
A custom character style can't be applied to a paragraph tag. Paragraph contents allow applying custom paragraph styles.
You can apply a custom character style to a and span tags. We recommend you to check the following included sample: Core/embedHTML/sample_4.php, that illustrates how to apply custom paragraph, character and table styles when transforming HTML to DOCX (the sample uses new custom styles but you can also apply existing and imported styles). From the previous sample:
$style = array(
'color' => '999999',
'border' => 'single',
'borderWidth' => 12,
'indentLeft' => 920,
);
$docx->createParagraphStyle('myParagraphStyle', $style);
$style = array(
'bold' => true,
'color' => 'ff0000',
'font' => 'Arial',
'fontSize' => 18,
'italic' => true,
'underline' => 'single',
);
$docx->createCharacterStyle('myCharacterStyle1', $style);
$style = array(
'color' => '0000ff',
'fontSize' => 21,
'underline' => 'double',
);
$docx->createCharacterStyle('myCharacterStyle2', $style);
$docx->embedHTML('<p class="myParagraphStyle">This <span class="myCharacterStyle1">paragraph</span> uses <span class="myCharacterStyle2">custom </span> styles.</p>', array('wordStyles' => array('.myParagraphStyle' => 'myParagraphStyle', '.myCharacterStyle1' => 'myCharacterStyle1', '.myCharacterStyle2' => 'myCharacterStyle2')));
Regards.