4 Replies - 601 Views - Last Post: 28 April 2013 - 02:08 PM

#1 sasikumar81a  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 28-April 13

Alignment problem in IE

Posted 28 April 2013 - 04:06 AM

Hi,
This is sasi and i'm new to PHP. In my project all the items are dispalyed properly in all browsers except in IE.
The alignments are changing in IE browsers
Is This A Good Question/Topic? 0
  • +

Replies To: Alignment problem in IE

#2 creativecoding  Icon User is offline

  • Hash != Encryption
  • member icon


Reputation: 928
  • View blog
  • Posts: 3,212
  • Joined: 19-January 10

Re: Alignment problem in IE

Posted 28 April 2013 - 08:39 AM

Hi sasi,

Internet Explorer is notorious for not following CSS and just.. doing whatever they want I guess. This makes is hard for us as developers to make cross-browser sites because some CSS will work in some browsers, and not in others. You have to ensure your CSS is compatible with Internet Explorer. Here's a site that lists a bunch of CSS stuff and what browsers they're supported in.

It may also be that IE has different defaults than your other browsers. For instance, say a webpage is given to both Chrome and IE. This webpage has no defined left padding on a paragraph. Chrome may think that's what the developer wants, and put 0px left padding. Internet Explorer may try to give the user a better reading experience or something, and put 10px left padding - meaning to overwrite that you have to manually define the left padding.

Lastly, you can detect if the user is running internet explorer and give him a proper stylesheet just for that.
Was This Post Helpful? 0
  • +
  • -

#3 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3806
  • View blog
  • Posts: 13,488
  • Joined: 12-December 12

Re: Alignment problem in IE

Posted 28 April 2013 - 09:16 AM

Ensure that your pages have valid DOCTYPE declarations, otherwise IE will drop into quirks mode.

Try validating your HTML and CSS; there are links in my signature. If either of these is incorrectly formed then there behaviour in different browsers will be unpredictable.

This post has been edited by andrewsw: 28 April 2013 - 09:16 AM

Was This Post Helpful? 1
  • +
  • -

#4 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3097
  • View blog
  • Posts: 10,883
  • Joined: 08-August 08

Re: Alignment problem in IE

Posted 28 April 2013 - 09:30 AM

View Postandrewsw, on 28 April 2013 - 12:16 PM, said:

Try validating your HTML and CSS; there are links in my signature. If either of these is incorrectly formed then there behaviour in different browsers will be unpredictable.

Quoted for emphasis.
Of course, you should always be doing this before taking a site live or testing on other browsers. You should use whatever you use to get your PHP code "working" and then when it does, validate the HTML and CSS. After that you can worry about browser compatibility.
Was This Post Helpful? 0
  • +
  • -

#5 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6106
  • View blog
  • Posts: 23,653
  • Joined: 23-August 08

Re: Alignment problem in IE

Posted 28 April 2013 - 02:08 PM

Seeing as this has NOTHING to do with PHP, I'm moving it to HTML and CSS.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1