Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > need refresher course to figure out what I'm doing wrong

Reply
Thread Tools

need refresher course to figure out what I'm doing wrong

 
 
richard
Guest
Posts: n/a
 
      09-18-2006
A simple case of having been out of the scene for so long I suppose.

What I can't understand is why firefox refuses to render the page correctly
as IE does and the editor (acehtml).

Just a simple layout. But firefox refuses to show the division under the
"top", that is "menu", and FF does not show the proper size of "top".

So enlighten me and help me get back on track of doing this right.



Thanks.





<?xml version="1.0" encoding="windows-1252"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- Created on: 9/16/2006 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title></title>

<style type="text/css">

#container

#top
{ width="100%"; height="140px";
background: #E69712 url('worldmap4b.png') no-repeat center;
z-index:-1;
font:arial, helvetica;
font-size:24pt;
text-align:center;
}


#left
{width="200px"; height="1000px"; background-color="#aabbcc"; float="left";

}
</style>
</head>
<body>

<div id="container">
<div id="top">

1 small world
</div>
<div id="left">
Menu
</div>
Body Content
</div>


</body>
</html>


 
Reply With Quote
 
 
 
 
Andy Dingley
Guest
Posts: n/a
 
      09-18-2006

richard wrote:

> What I can't understand is why firefox refuses to render the page correctly
> as IE does and the editor (acehtml).


I haven't even looked at your page, but dollars to doughnuts FF is
right, IE is wrong, and the code isn't valid.

> So enlighten me and help me get back on track of doing this right.


Enlighten us first - tell us the URL. Fragments don't cut it because
for any non-trivial error, we need to see what the server is saying
too.


> <?xml version="1.0" encoding="windows-1252"?>


Don't use an XML prolog on web content

Don't use a Windows codepage on web content

> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">


Don't use XHTML unless you know what you're doing and why.

Don't use XHTML 1.1

Don't even think about writing XHTML without validating it.

> <head>


If you insist on using XHTML, do it right.


> <style type="text/css">
>
> #container
>
> #top
> {


This is probably a typo for "#top" when what you've actually coded as a
selector is "#container #top" However it shouldn't actually hurt in
this case, and may even be intended.

> width="100%"; height="140px";


Don't quote property values in CSS, I haven't tested this, but I
imagine Firefox is correctly rejecting this incorrect code, whilst IE
is attempting to auto-fix it up. I suspect this is the problem that's
actually causing trouble.

For all the rest, search the ng archives.

 
Reply With Quote
 
 
 
 
freemont
Guest
Posts: n/a
 
      09-18-2006
On Mon, 18 Sep 2006 03:17:42 -0600, richard wrote:

> A simple case of having been out of the scene for so long I suppose.
>
> What I can't understand is why firefox refuses to render the page
> correctly as IE does and the editor (acehtml).
>
> Just a simple layout. But firefox refuses to show the division under the
> "top", that is "menu", and FF does not show the proper size of "top".
>
> So enlighten me and help me get back on track of doing this right.


Corrected a bunch of typos in CSS:

<style type="text/css">

#container {
}
#top {
width:100%;
height:140px;
background: #E69712 url('worldmap4b.png') no-repeat center; z-index:-1;
font:arial, helvetica;
font-size:24pt;
text-align:center;
}
#left {
width:200px;
height:1000px;
background-color:#aabbcc;
float:left;
}

</style>

Shooting the file up to a validator would have found all this in the first
place.

--
"Because all you of Earth are idiots!"
¯`ˇ.¸¸.ˇ´¯`ˇ-> freemontŠ <-ˇ´¯`ˇ.¸¸.ˇ´¯
 
Reply With Quote
 
Thomas Jollans
Guest
Posts: n/a
 
      09-18-2006
On 18 Sep 2006 03:43:43 -0700
"Andy Dingley" <(E-Mail Removed)> wrote:

>
> [snip]
> > <?xml version="1.0" encoding="windows-1252"?>

>
> Don't use an XML prolog on web content

Why not ? It's completely correct - the only problem is that it throws
IE6 (and others?) into some quirks mode that creates problems.

> Don't use a Windows codepage on web content

...., use UTF-8 or an ISO-8859 encoding like iso-8859-1 (latin1) or
iso-8859-15 (latin9: variation of latin1, with EUR symbol).

> Don't use XHTML unless you know what you're doing and why.


XHTML is a lot more consistent than HTML<=4, making it easier to
support and possibly tags easier to recognise.

> Don't use XHTML 1.1


Why not ? It's the most current W3c recommendation. There's not much
(if any ) benefit over XHTML 1.0 Strict to the web site author though.

> Don't even think about writing XHTML without validating it.


validating is always good, but writing valid XHTML isn't harder than
HTML 4. You just need to know XML syntax, which is really not that hard.

> > <head>

>
> If you insist on using XHTML, do it right.


does this have anything to do with the "<head>" ?


To the original poster: make sure the code is valid, and give us a URL.
Don't trust IE, it has many bugs. I recommend writing with a almost
standards compliant (Opera, Konqueror, Safari, other KHTML) or
fairly standards compliant (Firefox, Seamonkey, KMeleon, other Gecko)
browser and and then tune around the bugs of IE. I wouldn't be
surprised if your web editor used the IE rendering engine internally,
so don't be surprised that it displays "just as correctly" as IE.

Thomas Jollans
 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      09-18-2006

Thomas Jollans wrote:

> On 18 Sep 2006 03:43:43 -0700
> "Andy Dingley" <(E-Mail Removed)> wrote:


> > Don't use an XML prolog on web content

> Why not ? It's completely correct - the only problem is that it throws
> IE6 (and others?) into some quirks mode that creates problems.


Several browsers will fail to render the page at all.

The web, as it currently stands, is _not_ ready for XHTML except under
Appendix C. It just plain doesn't work right, unless you faff around
presenting it as text/html instead. And that's the _optimistic_,
pro-XHTML view of things! Many people still reckon that all XHTML is
_entirely_ inappropriate, and there's very few that have any tangible
benefit to using it. As for trying to make it fly in a purely XML
context, then that's simply unaceptable, this year, as the sole format
of content served.

As the OP is having trouble with basic CSS syntax, then it's most
unlikely he has anything to gain from XHTML, and certainly not from the
extremely narrow tightrope to walk that is using XHTML as XML.



> > > <head>

> >
> > If you insist on using XHTML, do it right.

>
> does this have anything to do with the "<head>" ?


Sorry, poor trimming on my part. Look at what's missing from <html>


> To the original poster:


How about actually fixing the obvious bug he has the problem with?

 
Reply With Quote
 
richard
Guest
Posts: n/a
 
      09-18-2006
Thanks. That's kind of what I figured but I wasn't seeing it.

 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-18-2006
richard wrote:
> ... I wasn't seeing it.
>


Neither am I! USENET TIP: Please quote relevant parts of the previous
message to which you are responding to.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't figure out what's wrong with this code Taras_96 C++ 3 01-29-2008 02:27 PM
Windows 98 SE: Need a refresher course rfdjr1@optonline.net Computer Support 6 11-20-2006 02:15 PM
Gridview delete logic problem - Can anyone figure out what's wrong? Steve ASP .Net 0 09-25-2006 08:39 AM
Can't Figure Out What is Wrong Wayne Wengert ASP .Net 6 02-28-2005 09:53 AM
Cant quite figure out whats wrong!? Help?? Simon Mansfield C Programming 6 12-06-2004 10:20 AM



Advertisments