bad coding... only works in IE

This is a discussion on "bad coding... only works in IE" within the Web Page Design section. This forum, and the thread "bad coding... only works in IE are both part of the Design Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Dec 16th, 2006, 12:37
Reputable Member
Join Date: Nov 2006
Location: London, England
Age: 15
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy bad coding... only works in IE

Right i have a large problem in the fact that i cant
get my dumb porfolio to work in FF (and probably any other browser - bar IE - my pc doesn't let them work though so i cant test thoroughly) the selection window wobbles around in IE and just totally messes up in FF.
NOTE: I adapted this from the CSS Play tutorial posted somewhere around this forum
here's the link to my portfoilio
and the CSS is here
Thanks,
Dapandyman.

Last edited by Dapandyman; Dec 16th, 2006 at 16:40.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Dec 16th, 2006, 16:40
Reputable Member
Join Date: Nov 2006
Location: London, England
Age: 15
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Re: bad coding... only works in IE

the gallery in CCS Play is here:
http://www.cssplay.co.uk/menu/gallery.html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Dec 16th, 2006, 17:06
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Re: bad coding... only works in IE

Start by sorting out your invalid html code, then you will have a basis to work on.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Dec 17th, 2006, 11:04
Reputable Member
Join Date: Nov 2006
Location: London, England
Age: 15
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Re: bad coding... only works in IE

theres still three things making my html invalid:
2 are inflicted by my (rubbish) hosts freewebs.
1 is that
Quote:
document type does not allow element "HTML" here .
anything i try doesn't seem to fix that one.....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Dec 17th, 2006, 11:25
Up'n'Coming Member
Join Date: Jun 2006
Location: Northern Ireland, United Kingdom
Age: 22
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Re: bad coding... only works in IE

Why do you have div tags and other content OUTSIDE the html tag? You've got code, and THEN you start the html and head tag, put your code inside the proper tags, not above them
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Dec 17th, 2006, 18:12
Reputable Member
Join Date: Nov 2006
Location: London, England
Age: 15
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Re: bad coding... only works in IE

thats very true but it comes up with more validation errors
screw that ill put the code right - no matter what the validation says,
Thanks,
Dapandyman.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Dec 17th, 2006, 18:50
Up'n'Coming Member
Join Date: Jun 2006
Location: Northern Ireland, United Kingdom
Age: 22
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Re: bad coding... only works in IE

Yeah keep the code properly as it should be, the errors even though there are more, will actually be solveable, the ones beforehand were just gobblygook because your code wasnt even in the body, what errors are coming up and i'll help you out, take some screenies of the validation errors or paste them in here
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Dec 18th, 2006, 09:21
Reputable Member
Join Date: Sep 2006
Location: Rothwell
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Re: bad coding... only works in IE

Did u put ur code right? There is still a mess there

<title>.::Portfolio - Graphics::.</title>
<link rel=stylesheet href="style.css" type="text/css">
<div id="navcontainer">
<ul id="navlist">
<li><a href="index.htm">Home</a></li>
<li><a href="wport.html">Web Portfolio</a></li>
<li><a href="gport.html">Graphics Portfolio</a></li>
<li><a href="about.html">About Us</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>

<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="gport.css">
</head>
<body>


check it
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Dec 18th, 2006, 18:08
Reputable Member
Join Date: Nov 2006
Location: London, England
Age: 15
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Re: bad coding... only works in IE

no - i didnt get the chance...
computer go bye-bye.....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Dec 18th, 2006, 18:11
Reputable Member
Join Date: Nov 2006
Location: London, England
Age: 15
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Re: bad coding... only works in IE

done that now looks like this:


<html>
<head>
<title>.::Portfolio - Graphics::.</title>
<link rel=stylesheet href="style.css" type="text/css">
<div id="navcontainer">
<ul id="navlist">
<li><a href="index.htm">Home</a></li>
<li><a href="wport.html">Web Portfolio</a></li>
<li><a href="gport.html">Graphics Portfolio</a></li>
<li><a href="about.html">About Us</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>

<link rel="stylesheet" type="text/css" href="gport.css">
</head>
<body>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Dec 18th, 2006, 18:12
Up'n'Coming Member
Join Date: Jun 2006
Location: Northern Ireland, United Kingdom
Age: 22
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Re: bad coding... only works in IE

Quote:
Originally Posted by Dapandyman View Post
no - i didnt get the chance...
computer go bye-bye.....
If you get the chance, do it and then show us the types of errors you get
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Dec 18th, 2006, 18:12
Up'n'Coming Member
Join Date: Jun 2006
Location: Northern Ireland, United Kingdom
Age: 22
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Re: bad coding... only works in IE

Quote:
Originally Posted by Dapandyman View Post
done that now looks like this:


<html>
<head>
<title>.::Portfolio - Graphics::.</title>
<link rel=stylesheet href="style.css" type="text/css">
<div id="navcontainer">
<ul id="navlist">
<li><a href="index.htm">Home</a></li>
<li><a href="wport.html">Web Portfolio</a></li>
<li><a href="gport.html">Graphics Portfolio</a></li>
<li><a href="about.html">About Us</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>

<link rel="stylesheet" type="text/css" href="gport.css">
</head>
<body>
Aah we replied at the same time Ok so what errors are you getting?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Dec 18th, 2006, 18:13
Reputable Member
Join Date: Nov 2006
Location: London, England
Age: 15
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Re: bad coding... only works in IE

ok validation has come up with the following problems:
  1. Error Line 20, column 55: document type does not allow element "LINK" here . <link rel="stylesheet" type="text/css" href="gport.css"> The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
    One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).

  2. Error Line 21, column 6: end tag for element "HEAD" which is not open . </head> The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.
    If this error occured in a script section of your document, you should probably read this FAQ entry.

  3. Error Line 22, column 5: document type does not allow element "BODY" here . <body> The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
    One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Dec 18th, 2006, 18:14
Reputable Member
Join Date: Nov 2006
Location: London, England
Age: 15
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Re: bad coding... only works in IE

also there are 2 errors made by freewebs:
  1. Error Line 112, column 66: end tag for "DIV" omitted, but its declaration does not permit this . ... type="text/javascript" src="/i.js"></script></body>
    • You forgot to close a tag, or
    • you used something inside this tag that was not allowed, and the validator is complaining that the tag should be closed before such content can be allowed.
    The next message, "start tag was here" points to the particular instance of the tag in question); the positional indicator points to where the validator expected you to close the tag.

  2. Error Line 112, column 66: end tag for "DIV" omitted, but its declaration does not permit this . ... type="text/javascript" src="/i.js"></script></body>
    • You forgot to close a tag, or
    • you used something inside this tag that was not allowed, and the validator is complaining that the tag should be closed before such content can be allowed.
    The next message, "start tag was here" points to the particular instance of the tag in question); the positional indicator points to where the validator expected you to close the tag.
I can asure you that i did not link to an 'i.js'.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Dec 18th, 2006, 18:16
Reputable Member
Join Date: Nov 2006
Location: London, England
Age: 15
Posts: 175
Thanks: 0
Thanked 0 Times in 0 Posts
Re: bad coding... only works in IE

i think the first error means i have to put all the css links in the body.
i don't know what's happening with the second one - as you can see, there's already an open 'head' tag...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16  
Old Dec 18th, 2006, 18:16
Up'n'Coming Member
Join Date: Jun 2006
Location: Northern Ireland, United Kingdom
Age: 22
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Re: bad coding... only works in IE

Quote:
Originally Posted by Dapandyman View Post
ok validation has come up with the following problems:
  1. Error Line 20, column 55: document type does not allow element "LINK" here . <link rel="stylesheet" type="text/css" href="gport.css"> The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
    One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
Put stylesheet in quotes like so rel="stylesheet" and revalidate, that should take care of that one
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #17  
Old Dec 18th, 2006, 18:17
Up'n'Coming Member
Join Date: Jun 2006
Location: Northern Ireland, United Kingdom
Age: 22
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Re: bad coding... only works in IE

Quote:
Originally Posted by Dapandyman View Post
ok validation has come up with the following problems:


2. Error Line 21, column 6: end tag for element "HEAD" which is not open . </head> The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.
If this error occured in a script section of your document, you should probably read this FAQ entry.


3. Error Line 22, column 5: document type does not allow element "BODY" here . <body> The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
Both of these should get fixed whenever you fix that rel="stylesheet"
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati