issue with IE and NN

liunx

Guest
Hi all,

<!-- m --><a class="postlink" href="http://www.islingtonboatclub.org.uk/">http://www.islingtonboatclub.org.uk/</a><!-- m --> (relevant link)

Ok, i can't make the main blue box which contains the main text to sit correctly in both IE and NN. It either sits perfectly in IE, but a horizontal scroll bar is needed to view it in NN, or perfectly in NN but drops down the page and needs a horizontal scroll bar in IE.

The change comes from altering my CSS.

Perfect in NN:

#navhorizontal {
margin-left:160px;
margin-top:0px;
margin-right:0px;
}

Perfect in IE:

#navhorizontal {
margin-left:160px;
margin-top:0px;
width:100%;
margin-right:0px;
}

(the left margin is because the left navigation div is 160px wide)

There is a table inside the main blue box, which is set to 100%, but even if i remove the width, it makes no difference.

At the time of posting this the CSS is set so it is perfect in IE, but i am trying to figure it out as well as posting, so this may change.

Any insights appreciated, this is confusing me.

Thanks,Remove the XML declaration and do this : #navhorizontal {
margin-left:160px;
}
* html #navhorizontal {
height:1px;
}Sorry if this sounds stupid, but won't removing the xml declaration somehow affect the way browsers address the page. I mean, will they simply revery to quirk mode or some other default?

Will give it a go though (in fact doing it now)Erm... you kind of have it the wrong way round - including the XML declaration throws IE into quirks mode. If you put anything other than a complete DTD at the top of the page, you'll get IE's quirks mode.Ok, problem appears to be resolved, but i'm confused.

I did as you said, but obviously it didn't validate course there was no declaration. So i put the declaration back in but left the style sheet as you suggested. And now it works in both IE and NN and validates.

So what happenned there then? :)

has this been fixed properly?
what did this...
* html #navhorizontal {
height:1px;
}
...actually do?

more than anything, would like to know, but thanks for the help

ta, julesHi bonrouge, sorry, i posted again before i read your post.

So what would a full DTD be. I thought i had mine right (but then again... :)

it is:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

As i said in my last post, it works and is validating, but that doesn't mean it is working correctly.

if you have the time to let me know more, that'd be great.

thanks again<?xml version="1.0" encoding="utf-8"?>That's the XML declaration.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">That's the Document Type Declaration, the DOCTYPE.

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">That starts the document proper; everything else is in the document's prolog. Note that in XHTML you don't have any P elements you have <!-- m --><a class="postlink" href="http://www.w3.org/1999/xhtml:p">http://www.w3.org/1999/xhtml:p</a><!-- m --> elements. The "xmlns" attribute prepends the namespace to that element and each child element.This is a complete DTD : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
You don't need XHTML, so you could use this instead : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" " <!-- m --><a class="postlink" href="http://www.w3.org/TR/html4/strict.dtd">http://www.w3.org/TR/html4/strict.dtd</a><!-- m --> ">
The part you really don't want is this :
<?xml version="1.0" encoding="utf-8"?>

(Of course, you need the html tag too, but if you use 'html4' you don't need all the stuff inside the tag - just '<html>' is fine).Yes, your best bet is to use HTML, but if you're going to use XHTML then do so properly and make your prolog look like:<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href=http://www.webdeveloper.com/forum/archive/index.php/"to-html.xsl"?> And then save the following as "to-html.xsl" in the same directory.<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
exclude-result-prefixes="xhtml"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output
doctype-public="-//W3C//DTD HTML 4.01//EN"
doctype-system="http://www.w3.org/TR/html4/strict.dtd"
encoding="iso-8859-1"
indent="yes"
method="html"
version="4.01"/>

<xsl:strip-space elements="*"/>

<xsl:template match="*">
<xsl:element name="{name()}">
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>

<xsl:template match="@*">
<xsl:copy/>
</xsl:template>

</xsl:stylesheet>I think what Charles is trying to say is that you're best not using XHTML as you probably don't know the correct syntax (just as I don't)...

Sorry if I'm reading too much into your posts, Charles. (By the way, I've seen the error of my ways and removed references to XHTML from my little site...)
 
Back
Top