For code snippets we use pre tag in blogger. These appear in a straight line and breaks out of the layout. To enable scrolling for pre tags add overflow: auto;.

pre {
    overflow: auto;
}