Search code examples
htmlpre

having trouble with <pre> <code> on mobile


This issue has been bothing me for a while.

On this site http://www.mikedemar.com/timeline/

I have noticed that the content wraped in the tags goes outside the white boxes when viewing on mobile devices specifically iPhone.

Any ideas on how to fix this?

Thanks in advance.

  • Mike

Solution

  • CSS like this provide a good base:

    pre, code, kbd { -moz-tab-size:4; -o-tab-size:4; tab-size:4; }
    pre { white-space:pre-wrap; word-wrap:break-word; overflow:auto; }