Log in

View Full Version : Layout problem in IE



redice
02-27-2006, 01:40 PM
Hi All,

Iv been working on the following webpage

http://www.etonuae.com/indextest.html

Now it opens perfectly in Mozilla firefox and in Safari, problem is
it opens really strangely in internet explorer.
Someone please explain.

Redice

jscheuer1
02-27-2006, 02:16 PM
I suggest you validate (http://validator.w3.org/check?verbose=1&uri=http%3A//www.etonuae.com/indextest.html) your page. Correcting those errors will probably take care of the problem or at least make it clear what the trouble is. One thing that is confusing the heck out of IE is your frequent insertion into element tags of a quotation mark that doesn't belong. These errors will appear in the validator as:


Error Line 48 column 38: an attribute specification must start with a name or name token.

<td background="images/pix_2.jpg" "style="background-repeat:repeat-y; backgr

An attribute name (and some attribute values) must start with one of a restricted set of characters. This error usually indicates that you have failed to add a closing quotation mark on a previous attribute value (so the attribute value looks like the start of a new attribute) or have used an attribute that is not defined (usually a typo in a common attribute name).

and similar. Here is how it looks in the HTML code, with the extra quote highlighted:


<td background="images/pix_2.jpg" "style="background-repeat:repeat-y; background-position:right ">

redice
02-27-2006, 02:37 PM
Thanks alot.
Let me get right onto that

redice

redice
02-27-2006, 03:25 PM
Done,

Can now see the site better in explorer.
I validated it once more i still get 51 errors mostly

required attribute "ALT" not specified
there is no attribute "BACKGROUND"

Though these dont really seem to be like errors to me. Please
correct me and explain to me what errors these are

Redice

jscheuer1
02-27-2006, 07:42 PM
Well, aside from the body tag, background is not an attribute, though many browsers recognize it as such. Where you have:


background="images/rep_top.jpg" style="background-repeat:repeat-x; background-position:top "

and similar for many of your table cells, it could more properly be expressed and combined as:


style="background:url('images/rep_top.jpg') top repeat-x;"

The thing about the alt attribute is simply a required convention for validation that all image tags have alt attributes. This is so that if the image is missing, the user can see some text to explain what should be there. This gets a little complicated because IE incorrectly uses the alt attribute as a tooltip in the absence of the optional title attribute. However you can fool the validator by using an empty alt attribute:


alt=""

Or better still, use a descriptive alt attribute but, if you do not want the tooltip effect in IE, also include an empty title attribute.