---
title: "ogiltig attribute?"
type: "forum-thread"
url: "https://www.webforum.nu/amne/html-css/127232-ogiltig-attribute"
topic: "HTML & CSS"
topic_url: "https://www.webforum.nu/amne/html-css"
author: "Bosse168"
published: "2005-04-27T18:04:18.000Z"
updated: "2005-04-27T18:55:56.000Z"
replies: 8
views: 348
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/html-css/127232-ogiltig-attribute"
---

# ogiltig attribute?

## #1 — Bosse168, 2005-04-27T18:04Z

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.

&#9993;
\#

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

\<td background="bilder/top_mid.gif" height="51" width="374"\>&nbsp;\</td\>

&#9993;
\#

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

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

Permalänk: https://www.webforum.nu/p/127232

## #2 — missModesty, 2005-04-27T18:12Z

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

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

Permalänk: https://www.webforum.nu/p/1600432

## #3 — zcorpan, 2005-04-27T18:13Z

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

Permalänk: https://www.webforum.nu/p/1600433

## #4 — @nders, 2005-04-27T18:16Z

Använd CSS då.

1) margin-top:0; margin-bottom:0;
2) background-image: url(bilder/top_mid.gif);
3) vertical-align:bottom;

Permalänk: https://www.webforum.nu/p/1600437

## #5 — Bosse168, 2005-04-27T18:17Z

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

Permalänk: https://www.webforum.nu/p/1600439

## #6 — jarvklo, 2005-04-27T18:30Z

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

Permalänk: https://www.webforum.nu/p/1600447

## #7 — doggelito, 2005-04-27T18:42Z

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;">
```

Permalänk: https://www.webforum.nu/p/1600455

## #8 — @nders, 2005-04-27T18:43Z

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

Mvh

Permalänk: https://www.webforum.nu/p/1600456

## #9 — missModesty, 2005-04-27T18:55Z

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

Permalänk: https://www.webforum.nu/p/1600465

---

Tråden på webben: https://www.webforum.nu/amne/html-css/127232-ogiltig-attribute
