Today, there is a problem, not enough to center a good-looking, more than one line centered and difficult to see:
Center
Justify on both sides
First want to use Text-align-last:center; But the result is this:
The center of a single line
But the last line of multiple lines is also centered ...
Later changed to this:
1 <Divclass= "text"><P>2. Tap WiFi Key Search</P></Div>2 <Divclass= "text"><P>3. Please wait 5-15 secs in your Wi-Fi Settings for WiFi list to load. Tap on hotspots with "Wi-Fi Master key WiFi key Search" to connect</P></Div>
. Text{width:285px;margin:Auto;padding:8px;Background-color:#d8d8d8;text-align:Center;font-size:15px;Color:#333;}. Text P{Display:Inline-block;margin:Auto;text-align:Justify;}
can let P text-align:justify;display:inline-block; Add an outer box div to P, this outer box text-align:center;
So p changes with the width of the text, and P is centered in the Div, and it looks centered when the P-width is not enough.
The effect is realized
The CSS is centered when it is not a single line, and is justified on more than one line