Please have a loo at this old thread :- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...
// Currently only supports the basic html tags and not custom one. Verify html serializer/processor /at libs/cq/ui/widgets/source/widgets/form/rte . This basically means that unsupported HTML that was entered will get stripped/removed.
As a workaround, i will suggest that you create a custom plain HTML component that is suitable for your use case and not use the Richtext. Another possibility is to create a new plugin to support such a use case.
To create a custom plugin :- https://mkbansal.wordpress.com/2016/01/09/aem-rte-custom-styles-plugin/
i hope this would help you.
~kautuk
Kautuk Sahni