Hi there
I am working on a template for a new website and the homepage looks fine in every browser except IE (all versions).
I believe it has something to do with the line of code below as this shows up at the top of the page:

<!--[if lt IE]> <![endif]-->  

<!--[if lt IE]>
   <link rel="stylesheet" href="ie.css" type="text/css" media="screen">
<![endif]-->

Can anybody help?

http://home.comcast.net/~waynetorrance/roomies/index.html

Dani AI

Generated

Two distinct bugs are visible from the thread: a conditional-comment string being rendered as page text, and a footer that intrudes into long blocks of content. The first usually means the conditional comment is malformed, has been HTML‑escaped by an editor, or is placed outside the HTML head/doctype; the second is a classic un‑cleared‑floats problem. Short diagnostics and fixes follow.

Confirm whether the conditional comment is raw HTML or escaped entities by viewing the page source in IE (View Source or F12). If the comment appears with &lt;/&gt; it has been HTML‑encoded and will print as text; restore raw comment syntax and place it inside the document head. Conditional comments must test against a version (for example, older IEs):

<!--[if lt IE 9]>
<link rel="stylesheet" href="css/ie.css">
<![endif]-->

For the footer overlap: the container holding floated columns probably collapses, so the footer sits up into the content. Reliable fixes are a clearfix on the float container, forcing a block formatting context, or giving the footer a clear. Examples:

/* clearfix for older IE */
.clearfix:after {
  content: "";
  display: table;
  clear: both;
}

/* or cause a BFC */
.wrapper { overflow: auto; }

/* simple fallback */
footer { clear: both; }

/* IE6/7: trigger hasLayout if needed */
.container { zoom: 1; }

Other practical checks: ensure a standards doctype (<!DOCTYPE html>) to avoid quirks mode, validate for unclosed tags, remove stray/empty conditional-comment lines, and remember conditional comments are ignored in IE10+ (use feature detection for modern fallbacks). As noted, the footer symptom matches un‑cleared floats; fixing the conditional‑comment encoding/placement plus a clearfix or overflow fix typically resolves both issues.

Recommended Answers

All 4 Replies

If you haven't got a file called ie.css in your website you can take it out without any problems. It looks like you have a problem with the footer part of the page in IE

I have a file called ie.css. Every other browser looks fine. IE is causing me headaches. I took out the line of code that corresponded with it and the whole page turned to crap. Do I have to take out the ie.css file as well?? (thank you for your quick reply!)

Solved! yeah!
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.