I didn't found any solution to this, so i did a workaround. In case anyone will be looking for this: I created DTCSSStylesheet with specifying a css for html tags with padding. And then i DTCoreTextContentViewDelegate method drew a border.
- (BOOL)attributedTextContentView:(DTAttributedTextContentView *)attributedTextContentView shouldDrawBackgroundForTextBlock:(DTTextBlock *)textBlock frame:(CGRect)frame context:(CGContextRef)context forLayoutFrame:(DTCoreTextLayoutFrame *)layoutFrame
{
UIBezierPath *roundedFrame = [UIBezierPath bezierPathWithRoundedRect:frame cornerRadius:5];
CGColorRef color = [textBlock.backgroundColor CGColor];
if (color)
{
CGContextSetFillColorWithColor(context, color);
}
CGContextAddPath(context, [roundedFrame CGPath]);
CGContextFillPath(context);
CGContextAddPath(context, [roundedFrame CGPath]);
CGContextSetRGBStrokeColor(context, 0, 0, 0, 1);
CGContextStrokePath(context);
return NO; // draw standard background
}