Avatar billede n-emy Nybegynder
03. januar 2006 - 17:14 Der er 8 kommentarer og
1 løsning

Validerings fejl?

Hej,

Jeg er igang med at validere en side(www.n-gamez.dk/test.php):

jeg får følgende fejl:
Error  Line 35, column 60: document type does not allow element "LINK" here .

<link rel="stylesheet" type="text/css" href="stylesheet.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).


Men ved ikke hvad fejlen er?
Avatar billede michael_stim Ekspert
03. januar 2006 - 17:17 #1
Har du den liggende i head-taggen?
Avatar billede roenving Novice
03. januar 2006 - 17:20 #2
Det er fordi du har et xhtml-tag lige foran:

icon.png" />

-- fjern skråstregen !-)
Avatar billede n-emy Nybegynder
03. januar 2006 - 17:34 #3
Okay tak:)

ved godt jeg ikke spurgte om det her men får også de her fejl:
# Error  Line 38, column 57: there is no attribute "TOP-MARGIN" .

<BODY BACKGROUND="../../../billeder/bagg.jpg" TOP-MARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">

You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.

&#9993;
# Error Line 38, column 73: there is no attribute "MARGINWIDTH" .

...lleder/bagg.jpg" TOP-MARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">

&#9993;
# Error Line 38, column 90: there is no attribute "MARGINHEIGHT" .

...GIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">

&#9993;
# Error Line 49, column 21: there is no attribute "WIDTH" .

<div id="divs" width="566">



Kan bare ikke finde ud af hvad den mener?
Avatar billede roenving Novice
03. januar 2006 - 17:40 #4
Det er fordi du bruger html3.2-attributter !-)

-- skriv dem ind som styles i stedet for, enten i stylesheet:

body{
  background-image: url(../../../billeder/bagg.jpg);
  margin:0;
  padding:0;
}

-- eller direkte på tagget:

<body style="background-image: url(../../../billeder/bagg.jpg);margin:0;padding:0;">

-- og f.eks.

<div id="divs" style="width:566px;">
Avatar billede n-emy Nybegynder
03. januar 2006 - 22:41 #5
Hvad kan man bruge istedet for cellspacing="0" og cellpading="0"?

har prøvet style="cellspacing: 0px; cellpading: 0px;" men det virker ikke?
Avatar billede roenving Novice
03. januar 2006 - 22:45 #6
Det er du nødt til at skrive i et stylesheet, f.eks.

#minTabel{
  width:500px;
  border:0;
  border-collapse:collapse;
}
#minTabel td{
  margin:0;
  padding:0;
}
Avatar billede n-emy Nybegynder
03. januar 2006 - 22:57 #7
Hmm det giver ikke den effekt det skal:
http://n-gamez.dk/test.php
i venstre side har jeg brugt det stylesheet og afstanden er mindre hos de andre røde bokse.
Avatar billede roenving Novice
03. januar 2006 - 23:02 #8
F.eks.

<style type="text/css">
.tabel{
  border-collapse:collapse;
}
.tabel td{
  margin:0;
  padding:0;
}
</style>
Avatar billede roenving Novice
11. januar 2006 - 14:05 #9
-- og tak for point ;~}
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester