webForumDet fria alternativet

ogiltig attribute?

8 svar · 330 visningar · startad av Bosse168

Bosse168Medlem sedan nov. 20031 019 inlägg
#1

Försöker att få min kod att gå igenom på http://validator.w3.org/check och har fått all kod godkänd förrutom på dessa rader och har inte en aning hur jag ska gå tillväga, så hoppas på hjälp ifrån er. :)

#

Line 18, column 37: there is no attribute "MARGINHEIGHT"

<body bgcolor="#DAE8F6" marginheight="0" text="#000000" vlink="#6699ff">

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.


#

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

<td background="bilder/top_mid.gif" height="51" width="374"> </td>


#

Line 111, column 61: there is no attribute "VALIGN"

...img src="bilder/mitt_top.gif" valign="bottom" border="0" height="34" width="4

missModestyMedlem sedan apr. 2005228 inlägg
#2

Här kan du kolla vart attributen hör:

http://www.w3.org/TR/html4/index/attributes.html

zcorpanMedlem sedan dec. 20042 269 inlägg
#3

Du får använda CSS istället. :)

@ndersMedlem sedan juni 200026 914 inlägg
#4

Använd CSS då.

  1. margin-top:0; margin-bottom:0;
  2. background-image: url(bilder/top_mid.gif);
  3. vertical-align:bottom;
Bosse168Medlem sedan nov. 20031 019 inlägg
#5

Hur ser en CSS fil ut som gör dom grejorna?

jarvkloMedlem sedan juli 20013 295 inlägg
#6

Hmm

Egentligen behöver du inte skapa en CSS-fil bara för de där inställningarna, för du kan välja att lägga dem direkt i varje tagg om du vill...

<body style="margin-top:0; margin-bottom:0;">
...
<td style="background-image: url(bilder/top_mid.gif);">

...
<img ... style="vertical-align:bottom">

Men det där med vertical-align på en bild kommer antagligen inte att funka som du tänkt dig (vertical-align funkar bara inuti en tabellcell och inom radhöjden i löpande text ;) - that's life in CSS )

//red - det är feligt att mänskla (se nedan) :birp

doggelitoMedlem sedan juni 20003 100 inlägg
#7

och om du tänker använda koden ovan så byt bodyn till denna, jarvklo var lite för snabb :)

<body style="margin-top:0; margin-bottom:0;">
@ndersMedlem sedan juni 200026 914 inlägg
#8

Det var nog jag som var lite snabb, och jarvklo som klippte det jag skrev. Jag skrev helt enkelt fel. Korrigeras genast! :)

Mvh

missModestyMedlem sedan apr. 2005228 inlägg
#9

Men det där med vertical-align på en bild kommer antagligen inte att funka som du tänkt dig

Det kom mig att tänka på en artikel jag ramlade över en gång. Så efter lite rotande hittade jag den:

http://www.wpdfd.com/editorial/wpd0103.htm#toptip

Alla knep är bara utom de dåliga... ;)

Genererad på 370 ms · cache AV · v20260730165559-full.f96bc7eb