rory
rory

Reputation: 1438

pasted text in textarea overflows even though spaces are existent

When someone manually types in the text area the line breaks happen where I want them. However, if someone pastes a wall of text from somewhere else the linebreaks don't occur and the autoscroll kicks in leaving my lovely blog with a crappy horizontal scroll bar in the blog-subject field.

Blog here so you can see what I'm talking about (link to post entries at bottom of page if you want to try...).

Thanks in advance for your help

Upvotes: 0

Views: 95

Answers (3)

Replay
Replay

Reputation: 51

Just specify a width for .blog-content and then use word-wrap: normal;.

.blog-content {
  font-family:monospace;
  font-size:12px;
  overflow:auto;
  width: 100%;
  word-wrap: normal;
}

Upvotes: 2

Mihai Alex
Mihai Alex

Reputation: 678

Try adding white-space: normal;

.blog-content {
    font-family: monospace;
    font-size: 12px;
    overflow: auto;
    white-space: normal;
}

Upvotes: 1

CaribouCode
CaribouCode

Reputation: 14398

The blog posts are currently wrapped in <pre> tags. The point of pre tags is that they preserve line breaks and white space. This is probably not what you want for this situation.

Change the pre tags to divs and your problem is solved.

Upvotes: 1

Related Questions