Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-09-2009, 09:12 PM   PM User | #1
IFeelYourPain
Regular Coder

 
Join Date: Sep 2007
Posts: 250
Thanks: 19
Thanked 0 Times in 0 Posts
IFeelYourPain has a little shameless behaviour in the past
<pre> in IE

I'm using CSS to fix my content so that it will properly display txt files:
white-space: pre;

However this does not work in IE.

Ideas?
IFeelYourPain is offline   Reply With Quote
Old 05-10-2009, 08:48 AM   PM User | #2
SB65
Senior Coder

 
Join Date: Feb 2009
Location: West Yorkshire
Posts: 2,817
Thanks: 9
Thanked 681 Times in 675 Posts
SB65 will become famous soon enoughSB65 will become famous soon enough
I'd guess it's an absent or incorrect doctype causing the issue in IE.
SB65 is online now   Reply With Quote
Old 05-10-2009, 04:03 PM   PM User | #3
IFeelYourPain
Regular Coder

 
Join Date: Sep 2007
Posts: 250
Thanks: 19
Thanked 0 Times in 0 Posts
IFeelYourPain has a little shameless behaviour in the past
Quote:
Originally Posted by SB65 View Post
I'd guess it's an absent or incorrect doctype causing the issue in IE.
How can I fix that?
IFeelYourPain is offline   Reply With Quote
Old 05-10-2009, 04:27 PM   PM User | #4
SB65
Senior Coder

 
Join Date: Feb 2009
Location: West Yorkshire
Posts: 2,817
Thanks: 9
Thanked 681 Times in 675 Posts
SB65 will become famous soon enoughSB65 will become famous soon enough
You need to add the doctype statement right at the start of your html code - have a look at the sticky thread at the top of the board for some references, or try this site.

The doctype will depend on how you've written your html, but it will look something like this:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
SB65 is online now   Reply With Quote
Old 05-12-2009, 08:53 PM   PM User | #5
IFeelYourPain
Regular Coder

 
Join Date: Sep 2007
Posts: 250
Thanks: 19
Thanked 0 Times in 0 Posts
IFeelYourPain has a little shameless behaviour in the past
Quote:
Originally Posted by SB65 View Post
You need to add the doctype statement right at the start of your html code - have a look at the sticky thread at the top of the board for some references, or try this site.

The doctype will depend on how you've written your html, but it will look something like this:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
I've tried everyone of them listed on that website. No result. =[
IFeelYourPain is offline   Reply With Quote
Old 05-12-2009, 09:32 PM   PM User | #6
SB65
Senior Coder

 
Join Date: Feb 2009
Location: West Yorkshire
Posts: 2,817
Thanks: 9
Thanked 681 Times in 675 Posts
SB65 will become famous soon enoughSB65 will become famous soon enough
Here's some basic code that works in IE - the text appears on two lines.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Pretest</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<style type="text/css" media="screen">
p{white-space:pre}
</style>
</head>

<body>
<p>Some 
   text</p>
</body>
</html>
Hope this helps.
SB65 is online now   Reply With Quote
Old 05-12-2009, 11:16 PM   PM User | #7
timgolding
Senior Coder

 
timgolding's Avatar
 
Join Date: Aug 2006
Location: Southampton
Posts: 1,460
Thanks: 89
Thanked 110 Times in 109 Posts
timgolding is on a distinguished road
Arrow

But you will have to put these codes in each of the popups or use a popup.php like the one i provided in the other thread with this stuff in that.

PHP Code:
<?php
if(isset($_GET["file"]))
{
   
$file=$_GET["file"];
   if(!
preg_match('#^/files/[A-Z]/(^/)\.txt$#'$file))
   exit;
}
else exit;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Pretest</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<style type="text/css" media="screen">
p{white-space:pre}
</style>
</head>

<body>
<p>
<?php
   
         $str 
file_get_contents($file);
         echo 
$str
?>
</p>
</body>
</html>
So you have a choice you either use the codes i provided in either of the two threads or you have to copy and paste SB65's code in each of your 100's of popups. But if your going to do that you might as well just put <br> in instead!

For anyone who wonders what an earth I'm talking about look here
http://codingforums.com/showthread.php?t=165918
__________________
You can not say you know how to do something, until you can teach it to someone else.

Last edited by timgolding; 05-12-2009 at 11:21 PM..
timgolding is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:38 AM.


Advertisement
Log in to turn off these ads.