pre tag is being formatted strangely in page

Posted by morpheous on Stack Overflow See other posts from Stack Overflow or by morpheous
Published on 2010-05-01T12:07:11Z Indexed on 2010/05/01 12:37 UTC
Read the original article Hit count: 174

Filed under:
|

I am outputting some code in one of my pages, using a <pre> tag.

The code is being output correctly, but for some strange reason, the first line of the code is indented (i.e. shifted to the right, by quite a large amount).

I am not applying any style to that element, and I checked in FF Firebug and no styling is being applied, so I have no idea why the first line is shifted by so much to the right - any ideas?

the code that generates the tag looks like this:

<pre>
<?php echo $script_code; ?>
</pre>

The generated code looks like this:

<iframe
    src="http://www.example.com">
</iframe>

Any ideas what may be going wrong?

© Stack Overflow or respective owner

Related posts about php

Related posts about html