ogiltig attribute?

HTML & CSS

8 svar · 348 visningar · startad av Bosse168

Medlem sedan nov. 20031 018 inlägg
Trådstart#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

Medlem sedan apr. 2005254 inlägg
#2

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

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

Medlem sedan dec. 20042 245 inlägg
#3

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

Medlem sedan juni 200032 967 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;
Medlem sedan nov. 20031 018 inlägg
#5

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

Medlem sedan juli 20013 378 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

Medlem sedan juni 20003 076 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;">
Medlem sedan juni 200032 967 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

Medlem sedan apr. 2005254 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... ;)

310 ms totalt · 4 externa anrop · v20260731065814-full.d34c6d5a
141 ms — deklarationer (db)
0 ms — hämta statistik (cache)
159 ms — hämta tråd, inlägg och bilagor (db)
147 ms — ändringar (db)