Break lines do not show under IE but show under all other Web browsers

Hello,

We have a free Blog service as part of our Social networking services that allows people publish their ideas for discussion, etc.

These Blog pages are generated via Php and MySQL.

These Blog pages display correctly under all Web browsers, in regard to the break lines, but the break lines do not display correctly under IE browser.

You can see a sample page here:

Can you please tell me what we need to do to get IE to display the break lines correctly?

OTN, what the Hek is wrong with IE? It always behaves differently than other browsers :frowning:

FYI, we use nl2br when displaying the body of a Blog.

Regards,

I do not know what in the world is wrong with your code but something is terribly wrong with it. Because “BR” elements are supported by IE 7. Using some CSS to fix it…what? Something is terribly wrong here. And second…you are using HTML, so why are you using invalid XHTML style markup?

http://validator.w3.org/unicorn/check?ucn_uri=www.anoox.com%2Fnews%2Fshow_selected_article.php%3Farticle%3D41143&ucn_task=conformance#


<!--[if IE 7]>
br {display:block;margin-bottom:20px;}
<![endif]-->

Hi,

Is this a Javascript code?
Or what kind of code is it?
I mean I don’t know this:
[if IE 7]

[endif]

Or is this a new CSS coding language!

I mentioned to add it to your IE7 block, not for all of your css. In your html header you had a block that said if browser was IE7 then use these style properties. That is where you needed to add the br so that style ONLY applies to IE7.

Without going full bore into this the breaks work in IE8, at least for me. But they dont work in IE7. I do see IE7 only css code in your header, maybe thats affecting it? Again was just a quick scan.

Hi,

I implemented your suggestion, but now there are too much space for br for other browsers than IE!

So do you have a suggestion for adding the CSS code you provided only in case the browsers is IE?

I mean I know how to do browser sniffing with Javascript, but dont then how you write the CSS after you detect the browser type in JS!

ThanX

Hi,

Actually we are using a header that should address IE7 and IE peculiarities in general, that is:

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>

Boy, I hate IE :frowning:
Well any ideas you have to solve the Break lines not showing under IE will be appreciated.

I found other people having this issue but no real solution. So I just tried something and it seems to work. Add this to your IE7 block:


br {display:block;margin-bottom:20px;}