Jump to content

[SOLVED] <br/> not being displayed in IE


MrCreeky

Recommended Posts

That's the only code inserted to the string.

Should I have to call a function for this?

 

I know it's not cashe as I have been testing it on two different computers. One a Mac using both Firefox and Safari, the other My MacBook Pro running windows XP and using IE7 FireFox and Safari.

 

When using IE it losse's all the dubble  break line information and only displays one new line. As an example,

 

IE shows:

 

Hello World

This is the next line

 

FireFox and the rest show it like this:

 

Hello word

 

This is the next line

Link to comment
Share on other sites

I don't see any problems with the page, they both look exactly the same to me.

 

See Attachments:

 

If you look at the text on the left you will see in Firefox there are gaps where each new line starts.

 

Hello world

 

Hello world

 

In IE this is showing as:

 

Hello world

Hello world

 

 

----------------------

 

No idea why the page is showing <br> in IE and <br/> in FF

Link to comment
Share on other sites

@The Little Guy

Your screen shots don't look alike, there's no double line breaks in IE (there should be).

 

I tried to remove all CSS from the page, and the double breaks displayed just fine in IE. So the problem lies in your CSS. Your code is pretty messy though (no offense), so good luck locating the problem.

Link to comment
Share on other sites

The line

TBEC was founded and affiliated to the Auto Cycle Union in 1988 when we organised six fun enduro's; we now run between eight and eleven events a year.<br />
                           <br />

 

Is hand typed on the page but IE still shows it wrong:

 

TBEC was founded and affiliated to the Auto Cycle Union in 1988 when we organised six fun enduro's; we now run between eight and eleven events a year.

The aim of TBEC is to provide newcomers with a gentle.......

 

In Firefox the same text shows as it should be:

 

TBEC was founded and affiliated to the Auto Cycle Union in 1988 when we organised six fun enduro's; we now run between eight and eleven events a year.

 

The aim of TBEC is to provide newcomers with a gentle........

 

Link to comment
Share on other sites

Oh yes!

 

The CSS is only simple for that filed:

 

.maintext {font-family:Arial, Helvetica, sans-serif;font-size:12px;font-weight:lighterer;letter-spacing:0.1em;text-align:left;color: #000000;text-decoration: none;}
.maintext a:link {color: #006600;text-decoration: none;}
.maintext a:visited {color: #006600;text-decoration: none;}
.maintext a:hover {color: #ffffff;text-decoration: none;background-color: #006600;}
.maintext a:active {color: #ffffff;text-decoration: none;background-color: #006600;}

 

Why would that loss's the BR information?

Link to comment
Share on other sites

@OP

That part shouldn't have any effect on that. Just try to remove some parts, then test etc., and narrow it down.

 

BTW

 

font-weight:lighterer;

 

"lighterer" - are you serious? ;) Maybe you should look into validating your markup and CSS.

 

@redarrow

Oh, that may be the case too, didn't think of that. Although I've never heard of a doctype causing double line breaks to become single.

Link to comment
Share on other sites

Here is all the code from a test page I have just made, it all works fine until I add the Span tags

 

<?php require_once('Connections/tbec.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
 $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

 $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

 switch ($theType) {
   case "text":
     $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
     break;    
   case "long":
   case "int":
     $theValue = ($theValue != "") ? intval($theValue) : "NULL";
     break;
   case "double":
     $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
     break;
   case "date":
     $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
     break;
   case "defined":
     $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
     break;
 }
 return $theValue;
}
}

mysql_select_db($database_tbec, $tbec);
$query_Recordset1 = "SELECT blog FROM chairman";
$Recordset1 = mysql_query($query_Recordset1, $tbec) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>BR Test</title>
<style type="text/css">
<!--
.maintext {font-family:Arial, Helvetica, sans-serif;font-size:12px;font-weight:lighter;letter-spacing:0.1em;text-align:left;color: #000000;text-decoration: none;}
.maintext a:link {color: #006600;text-decoration: none;}
.maintext a:visited {color: #006600;text-decoration: none;}
.maintext a:hover {color: #ffffff;text-decoration: none;background-color: #006600;}
.maintext a:active {color: #ffffff;text-decoration: none;background-color: #006600;}
-->
</style>
</head>

<span class="maintext">
<?php echo nl2br($row_Recordset1['blog']); ?>
</span>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>

 

RE ererererer sorry I was rushing

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.