After spending the last hour designing a web page, I am stuck on a particular issue that I just can't seem to solve.
I need to write several paragraphs while adhering to two specific constraints:
1) The div in which the text resides must be centered, but I want the actual text inside to remain left-aligned. A good example is the links/text found at
2) I want to constrain the text to fit within the size of the div. If a line reaches the boundary, it should break wherever necessary and continue on the next line with left alignment. Even when the window is resized, I do not want any overflow to be hidden.
The <pre>
tags in my code have the class "preformatted," which I've customized as shown below:
.preformatted {
font-family: monospace;
white-space: nowrap;
text-align: center;
}
I apologize for the rookie question, but I have searched everywhere for a solution. Despite experimenting with overflow, whitespace, and other tags, I haven't had any luck. There must be an easier way to achieve this instead of manually adjusting each line like I'm currently doing.