Please help with PHP alignment problem?

samindra

New Member
My website I made in PHP displays left justified in Internet Explorer. All the content automatically aligns to the left only when my webpage is in PHP form and only when Internet Explorer loads it. All the other common web browsers display the page correctly.
Why is this happening? I tested the problem on multiple computers and the same thing happens. So did I maybe leave something out in my code? Is there something I need to add in to make my website compatible with Internet Explorer?
 

burn1337

New Member
Well the text alignment really doesn't have anything to do with php... Php just outputs what it is told to output.... If your using formatted outputting, then I can understand where that is coming from. IE has always had a problem with formatted outputting (most other browsers are cross platform compatible; hence the support of formatted output. IE is proprietary) ... I would suggest using css to align your text properly...
 

craftygeek

New Member
Its incredibly hard to help without being able to see your code...if you paste your code we will probably spot it quite easily, or at least point you in the right direction.
 

Razorback64

New Member
Your code is most likely fine. Internet Explorer is very hard to make a website for just because it looks at code differently then other browsers. The only thing that I know of that can help is to put all of the things on your website into a table. Internet Explorer works well with tables and usually displays them right. Unfortunately there isn't really a solve for this until Microsoft updates it to work properly.
 
Last edited:

RenaissanceMan

New Member
For God's sake don't advise the use of tables for layout - we've worked for years to try to eliminate that, don't take a step backward.

The only difference I can recall off the top of my head is that older versions of IE (and therefore newer versions in "quirks mode", so validate your markup) incorrectly apply "text-align" to block-level elements, which can be handy for centring a website as you can set:

Code:
body {
text-align: center; // Old IE will apply this to the wrapper div
}

div#wrapper {
width: 960px;
margin: 0 auto;
text-align: left; // To reset text within this div to left-aligned
}
 
Top