Interview Questions

Justified Text?

CSS Interview Questions and Questions


(Continued from previous question...)

97. Justified Text?

You redefine the <p> tag like:

p {text-align: justify;}

and that renders all <p>s with justified text.

Another possibility is to define a class, like:

.just {text-align: justify;}

and then you style the paragraphs in question like:

<td class="just">text </td>

Note that NN 4.xx has problems with the inheritance of styles; that some NN4.xx browsers have a funny way to interpret "justify"; and that you have to have at least one blank space between the last character and the </p> tag, because otherwise NN 4.xx likes to justify even a three word half-sentence... also, some browsers do a pretty ugly job of rendering justified text, adding spaces between words, instead of spaces between letters, as with word-processing programs.

(Continued on next question...)

Other Interview Questions