The design draft now looks like this, it supports 1-6 words, centered vertically and horizontally.
Text and pictures are obtained from the reading interface.
Here comes the difficulty. When there are four characters, two characters will wrap. When there are five characters, two characters will wrap. There are three characters below. When there are six characters, three characters will wrap. . If I limit the range of the text area, it must be the top three characters first, and then the bottom two characters.
Is there any layout expert who can help me solve this problem?
Call this function to process the text
Then make logical judgment directly in js, why should we use css to solve it
Style settings
Then in the retrieved data, determine the length of the text. If it is greater than two, add the <br> newline character after the second text
Use flex vertically and horizontally to set the text p size separately
Add newline character with js
wrap-reverse can reverse the first and second lines