The code is a bit of a pain to paste here, because it is very repetitive. Right now, the code in JavaScript creates 8 lines of 12 random letters each, based on a function with Math.random() that generates different letters. When those letters appear on the page, the problem is that, obviously, the letters each have a different length. Therefore, the lines are not all the same length and the result appears rather messy, because some lines end before/after others. Is there a way (in JS or CSS, whichever) to make sure that the lines are all exactly the same length?
Asked
Active
Viewed 192 times
0
-
If you are looking to spread a single line to a certain width : http://stackoverflow.com/questions/5976289/stretch-text-to-fit-width-of-div – Striker May 22 '16 at 11:54
1 Answers
1
you can use text-justify in the css for that. assuming that the generated text is in a p with a class of sampleText.
.sampleText{text-align:justify}

gavgrif
- 15,194
- 2
- 25
- 27