Site logo

Archived topic

Using the [pre] tag does not give line breaks but a horizontal scroll bar.

3 replies · Started by Christoph on August 3, 2020

Viewing posts 1–4 of 4

In my blog I often use the (pre) tags for quotes. (with the HTML "less than" and "Greater than" characters instead of brackets, but this formats the question text) In my previous style (twentythirteen) this created formatted text with word wrap. In GeneratePress, however, every paragraph is a single line with a horizontal scroll bar. How can I change this style to a text with automatic word wrap? Couldn't find it in the forum.

Example

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco 

Thanks :)

Hi there,

try this CSS:

pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

Works! Many thanks for the fast response :)

You're welcome

This archived topic is closed to new replies.