setDefaultStyle It works very badly in Text-Align
See original GitHub issue@JiHong88 hi By default, the Text-Align is left to right, and in this case everything works fine. But I used the following method to make the Text-Align , right to left by default
editor.setDefaultStyle("font-family: Vazir; font-size: 18px;text-align:right;direction:rtl");
But in this case, the text inside the editor is displayed from right to left, but when I display the text on my page, the text is from left to right. It seems that this method did not work
When I looked more closely, I realized that this method gives the styles to the editor itself, not to the text inside it.
How can we give default values to tools such as Text-Align, font, font size, direction, etc.? And apply to all texts entered in the editor.
Issue Analytics
- State:
- Created 3 years ago
- Comments:20 (7 by maintainers)
Top Results From Across the Web
setDefaultStyle It works very badly in Text-Align #563 - GitHub
When I looked more closely, I realized that this method gives the styles to the editor itself, not to the text inside it....
Read more >CSS text-align does not work - Stack Overflow
The text-align property does work in your example. It's just that the text is aligned regarding it's container. Which in this case is...
Read more >10 Bad Typography Habits that Scream Amateur | by Meetchopz
10 Bad Typography Habits that Scream Amateur · 1. Center-aligning paragraphs of text · 2. Too much or too little leading · 3....
Read more >style="text-align:center" vs align="center" vs <center>
I know of three different methods to align text in html. 1. ` text ` 2. ` text ` 3. ` text `...
Read more >text-align - CSS: Cascading Style Sheets - MDN Web Docs
The text-align CSS property sets the horizontal alignment of the ... This means it works like vertical-align but in the horizontal ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@JiHong88 Thank you again. Certainly your editor is the best for me, who has been looking for a good editor for years. And I’m waiting for these examples
Just to confirm if I am seeing the same issue, if you set the default style to text-align: center, you can then never get a piece of text in the editor to be left-aligned - is this the same issue or should I open a new one?