INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Using CSS for the pre tag. white-space: pre-line not working in Chrome

Using CSS for the pre tag. white-space: pre-line not working in Chrome

Using CSS for the pre tag. white-space: pre-line not working in Chrome

(OP)
Hello and happy Christmas

I've got several thousand documents which are transcriptions of Wills. The <pre> tag is around the transcription. In my CSS I currently have:

pre    {font-family: monospace;
	font-size: 1.75em;
	line-height: 1.75em;
}
 

Because of the nature of the documents, a lot of them are going over their margins, so I added in this piece to the CSS

white-space: pre-line; 

Now this is working in Internet Explorer and Firefox, but not in Chrome. I've tried the "modern browser" version from this code

pre {
  word-wrap: break-word;      /* IE 5.5-7 */
  white-space: -moz-pre-wrap; /* Firefox 1.0-2.0 */
  white-space: pre-wrap;      /* Modern browsers */
} 

which is from https://developer.mozilla.org/en-US/docs/Web/CSS/w... but that's not working either.

Can someone suggest what I can use? At the moment I'm manually formatting each item, but there are over 5000 of these and it's going to take forever!

thank you for helping

____________
Pendle

RE: Using CSS for the pre tag. white-space: pre-line not working in Chrome

You could always add an overflow to the <pre> and have it scroll if the contents is too wide for the allotted space.

CODE --> css

pre    {font-family: monospace;
	font-size: 1.75em;
	line-height: 1.75em;
overflow:scroll;
}

----------------------------------
Phil AKA Vacunita
----------------------------------
OS-ception: Running Linux on a Virtual Machine in Windows which itself is running in a Virtual Machine on Mac OSx.

Web & Tech

RE: Using CSS for the pre tag. white-space: pre-line not working in Chrome

(OP)
Hi

I've tried the overflow option you gave me but that's not worked. I've googled this and tried a number of different options, but none are working.

Perhaps this is a Chrome specific problem with no solution?


thank you for helping

____________
Pendle

RE: Using CSS for the pre tag. white-space: pre-line not working in Chrome

Why not? What happened when you used overflow?

Did the pre not get scroll bars?

Does the Pre have a determined width?



----------------------------------
Phil AKA Vacunita
----------------------------------
OS-ception: Running Linux on a Virtual Machine in Windows which itself is running in a Virtual Machine on Mac OSx.

Web & Tech

RE: Using CSS for the pre tag. white-space: pre-line not working in Chrome

(OP)
Hi

I've sorted it now using pre-wrap. No scroll bars though.

thanks for your help

thank you for helping

____________
Pendle

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close