/ Forside/ Teknologi / Udvikling / HTML / Spørgsmål
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
HTML
#NavnPoint
molokyle 11184
Klaudi 5506
bentjuul 3377
severino 2040
smorch 1950
strarup 1525
natmaden 1396
scootergr.. 1320
e.c 1150
10  miritdk 1110
hjælp til html dokument
Fra : mpjc
Vist : 499 gange
100 point
Dato : 31-07-05 16:50

Hej!

Jeg har lige kørt min forside gennem W3's html validation.

Den kommer med nogle fejl, men hvordan får jeg rettet så de bliver korrekte?

[citat]

1.

Line 27, column 29: there is no attribute "BACKGROUND"

<td width="5" background="/images/grafik/round_left.gif" class="style5"><div

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;
2.

Line 34, column 95: required attribute "ALT" not specified

...fik/logo.gif" width="700" height="75"><br>

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.

&#9993;
3.

Line 41, column 58: document type does not allow element "HTML" here

<td width="544" bgcolor="#FFFFFF" class="style3"><html>

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).

&#9993;
4.

Line 82, column 23: document type does not allow element "DIV" here; missing one of "APPLET", "OBJECT", "MAP", "IFRAME", "BUTTON" start-tag

<div align="left">

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

&#9993;
5.

Line 101, column 4: end tag for "DIV" omitted, but its declaration does not permit this

</td>

&#9993;
6.

Line 82, column 6: start tag was here

<div align="left">
7.

Line 101, column 4: end tag for "SPAN" omitted, but its declaration does not permit this

</td>

&#9993;
8.

Line 81, column 8: start tag was here

<td><span class="style5">


 
 
Accepteret svar
Fra : nebis

Modtaget 100 point
Dato : 31-07-05 20:26

[cite]
1.
Line 27, column 29: there is no attribute "BACKGROUND"
<td width="5" background="/images/grafik/round_left.gif" class="style5">
[/cite]
Den klager over "background" i "<td ...." Du kan undgå dette ved at slette "background=....." og i stedet tilføje et baggrundsbillede i din CSS-fil

[cite]
2.

Line 34, column 95: required attribute "ALT" not specified

...fik/logo.gif" width="700" height="75"><br>
[/cite]
Du mangler ALT="" der hvor du inkluderer dit billede, kan undgås ved at skrive
<img src="sti-til-billede" alt="Mit billede" width="700" height="75">

[cite]
3.

Line 41, column 58: document type does not allow element "HTML" here

<td width="544" bgcolor="#FFFFFF" class="style3"><html>
[/cite]
Du kan kun have én <html> og denne skal være i starten af dit html-dokument, slet derfor denne i linie 41


Kommentar
Fra : nebis


Dato : 31-07-05 20:29

4.-8. siger alle at der er problemer med start-end-tags, dvs. når du starter en <div> skal den også endes med en </div>, tilsvarende for <span> og </span>. Check dit dokument igennem for dette

God fornøjelse

Kommentar
Fra : molokyle


Dato : 31-07-05 20:33

Ad 1. ..og 3.)

background atributten findes IKKE. Du tænker muligvis på : style="background-image:url('./images/grafik/round_left.gif');"

..og desuden :

Citat
The "bgcolor", "height", "width", and "nowrap" attributes of the td element were deprecated in HTML 4.01.

The "bgcolor", "height", "width", and "nowrap" attributes of the td element are not supported in XHTML 1.0 Strict DTD.


Alt vedrørende layout bør du skrive ind i din CSS.

Derfor får du også fejl på dine div's ...align atributten er deprecated i HTML 4.01
Brug style="text-align:left;" i stedet

Ad 2.)
Citat
Required Attributes

Attribute Value Description

alt text Defines a short description of the image STF

src URL The URL of the image to display STF


Du SKAL angive en alt attribut for en <img...> markør !

</MOLOKYLE>



Kommentar
Fra : molokyle


Dato : 31-07-05 20:36

Hm..... kandu rykkede lidt rundt på min tekst

Måske det ville være enhjælp for os, hvis du lagde en URL hér?

</MOLOKYLE>

Kommentar
Fra : mpjc


Dato : 31-07-05 20:39

3.

Line 41, column 58: document type does not allow element "HTML" here

<td width="544" bgcolor="#FFFFFF" class="style3"><html> [ Grunden til dette er at jeg har en ny side inde i dokumentet ]

1.
Line 27, column 29: there is no attribute "BACKGROUND"
<td width="5" background="/images/grafik/round_left.gif" class="style5">
[/cite]
Den klager over "background" i "<td ...." [ Hvordan sætter man det ind i css ]

Kommentar
Fra : molokyle


Dato : 31-07-05 20:50

bgcolor="#FFFFFF" skal skives ind i din style3 CSS som background-color:="#FFFFFF; eller tilføjes som en separat style="..." ...eller udspecificeres i en class definition?

<style type="text/css">
td.minstil {
background-color:="#FFFFFF;
..osv.
}
</style>

.og så angive den:

<td class="minstil">

Mon ikke du skulle 'boge' den lidt i CSS? http://www.kandu.dk/dk/kurser/css/cssKursus.asp

</MOLOKYLE>

Kommentar
Fra : molokyle


Dato : 31-07-05 20:53

UPS... Fjern lige lighedtegnet og det dobbelte anførselstegn ="

background-color:="#FFFFFF;

..så der står : background-color:#FFFFFF;

..begge steder.

Sorry..

</MOLOKYLE>

Kommentar
Fra : mpjc


Dato : 31-07-05 21:06

Hej!

CSS skal jeg nok få kigget på det html'en jeg tænkte på....

Kommentar
Fra : molokyle


Dato : 31-07-05 23:06

Hvilken !DOCTYPE bruger du, når du validerer?

Det har betydning for resultatet at der er overensstemmelse mellem din kode og din !DOCTYPE. Bruger du loose eller strict dtd? ..hvis ikke du bruger en !DOCTYPE overhovedet vil det blive valideret som SGML og en browser som IE vil være i non-compliance mode.

</MOLOKYLE>

Kommentar
Fra : molokyle


Dato : 31-07-05 23:10
Kommentar
Fra : molokyle


Dato : 01-08-05 08:43

Når/hvis du erklærer HTML dokumentet som strict.dtd skal du huske at mange elementer der har med layout/præsentation at gøre er 'udgået' (deprecated) i HTML 4.01. Bla. <font>, <applet>, <basefont>, <center>, <dir>, <isindex>, <menu>, <s>, <strike>, <u> og <xmp>. Dette gælder også layout/præsentations parametre for <body>, <table>, <td>, <div>, <p> osv... det er bla. align="..", valign="..", bgcolor="..", height="..", width="..", "nowrap".

Du må huske at HTML handler om indhold = Hvad skal der være på siden? (tekst, billeder, lyd osv..)

..og CSS handler om layout = Hvor og hvorledes skal indholdet præsenteres? (skrifttype, størrelse, placering, farver, lydstyrke, printformater osv.)

Læs f.eks. : http://webdesign101.dk/

</MOLOKYLE>

Godkendelse af svar
Fra : mpjc


Dato : 06-08-05 15:06

Tak for svaret nebis.
                        

Du har følgende muligheder
Eftersom du ikke er logget ind i systemet, kan du ikke skrive et indlæg til dette spørgsmål.

Hvis du ikke allerede er registreret, kan du gratis blive medlem, ved at trykke på "Bliv medlem" ude i menuen.
Søg
Reklame
Statistik
Spørgsmål : 177409
Tips : 31962
Nyheder : 719565
Indlæg : 6407779
Brugere : 218874

Månedens bedste
Årets bedste
Sidste års bedste