Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

pendle666

Technical User
Jan 30, 2003
295
GB
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]pre {font-family: monospace;
font-size: 1.75em;
line-height: 1.75em;
}
[/pre]

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

[pre]white-space: pre-line;[/pre]

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

[pre]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 */
}[/pre]

which is from 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
 
You could always add an overflow to the <pre> and have it scroll if the contents is too wide for the allotted space.

CSS:
pre    {font-family: monospace;
	font-size: 1.75em;
	line-height: 1.75em;
[indent][indent][b]   overflow:scroll;[/b][/indent][/indent]
}

----------------------------------
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
 
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
 
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
 
Hi

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

thanks for your help

thank you for helping

____________
Pendle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top