---
title: "Background"
type: "forum-thread"
url: "https://www.webforum.nu/amne/html-css/1773-background"
topic: "HTML & CSS"
topic_url: "https://www.webforum.nu/amne/html-css"
author: "Viking"
published: "2002-01-18T22:27:00.000Z"
updated: "2002-01-20T11:43:00.000Z"
replies: 27
views: 437
page: 1
pages: 2
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/1773-background"
---

# Background

_Sida 1 av 2._

## #1 — Viking, 2002-01-18T22:27Z

Får detta "felmeddelande" på  <http://validator.w3.org> :

```
Error: there is no attribute "BACKGROUND" for this element (in this HTML version)
```

Så här ser den aktuella raden, taggen ut:

```
<table border="0" cellpadding="0" cellspacing="1" width="499" background="bilder/bg_table.gif">
```

 <http://validator.w3.org/check?uri=http%3A%2F%2Fwww.okkido.nu%2Fhenrik%2F&charset=%28detect+automatically%29&doctype=Inline> 

Tacksam för svar  :)

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

## #2 — frankof, 2002-01-18T22:47Z

Du får lösa det med css.
Eller skriva din sida med html3.2 ;)

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

## #3 — Viking, 2002-01-18T23:20Z

Hur kan man lösa det med CSS?  :) 

Inte så hemma på det  :(

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

## #4 — hypatia, 2002-01-19T00:05Z

Lägg till det här i head:

```
<style type="text/css">
table {	background-image : url(bilder/bg_table.gif);}
</style>
```

Några länkar där du kan läsa mer om hur man använder CSS:
 <http://www.jojoxx.net/css/> 
 <http://www.atiger.pp.se/dok/styltext.html> 
 [http://www.algonet.se/\~eva/ref/css/](http://www.algonet.se/~eva/ref/css/)

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

## #5 — Viking, 2002-01-19T09:16Z

Blir det den färgen även i den tabell där jag har en bakgrundsfärg? (#ffffff)

Ska prova! Tack!

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

## #6 — Viking, 2002-01-19T09:43Z

Så, fick göra en egen class för den tabellen  :) 

Nån som vet varför det inte fungerar med:

```
<link rel=stylesheet href="style.css" type="text/css">
```

? Ja, style.css existerade när jag provade, nu gjorde jag istället en include() i PHP, men skulle vilja använda \<link\>, lite renare kod  :)

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

## #7 — Web-Tor, 2002-01-19T11:42Z

Det skall funka med \<link\>.
Sätt "fnuttar" runt **stylesheet** och kolla att sökvägen är rätt till css-filen och att den verkligen innehåller rätt kod.

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

## #8 — Viking, 2002-01-19T11:46Z

```
<style type="text/css">
<!--

a:visited { font-family: verdana, arial, helvetica; color: #000000; text-decoration: underline; font-size: 10px;}
a:link { font-family: verdana, arial, helvetica; color: #000000; text-decoration: underline; font-size: 10px; }
a:hover { font-family: verdana, arial, helvetica; color: #330066; text-decoration: none; font-size: 10px; }
table { font-family: verdana, arial, helvetica; font-size: 10px; }
table.bgimg { font-family: verdana, arial, helvetica; font-size: 10px; background-image: url(bilder/bg_table.gif); }
td { font-family: verdana, arial, helvetica; font-size: 10px; }
tr { font-family: verdana, arial, helvetica; font-size: 10px; }
form { font-family: verdana, arial, helvetica; font-size: 10px; }
body { margin-top: 2; matgin-right: 0; margin-left: 0; margin-bottom: 0; background-image: url(bilder/background.gif);}

-->
</style>
```

Detta finns i filen. Borde inte vara något fel med den, för det funkar när den är i .html format och jag include():erar den på sidan...

Ska prova med fnuttar runt stylesheet...

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

## #9 — hypatia, 2002-01-19T12:00Z

Om du använder en extern css-fil ska inte nedanstående vara med i filen.

```
<style type="text/css">
<!-- 

-->
</style>
```

Lägg en länk till sidan du jobbar med så är det lättare att försöka hjälpa dig. :)

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

## #10 — Viking, 2002-01-19T12:10Z

OK, tack!  :) 

Sidan jag jobbar med står i min signatur  :)

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

## #11 — Viking, 2002-01-19T12:14Z

```
a:visited { font-family: verdana, arial, helvetica; color: #000000; text-decoration: underline; font-size: 10px;}
a:link { font-family: verdana, arial, helvetica; color: #000000; text-decoration: underline; font-size: 10px; }
a:hover { font-family: verdana, arial, helvetica; color: #330066; text-decoration: none; font-size: 10px; }
table { font-family: verdana, arial, helvetica; font-size: 10px; }
table.bgimg { font-family: verdana, arial, helvetica; font-size: 10px; background-image: url(bilder/bg_table.gif); }
td { font-family: verdana, arial, helvetica; font-size: 10px; }
tr { font-family: verdana, arial, helvetica; font-size: 10px; }
form { font-family: verdana, arial, helvetica; font-size: 10px; }
body { margin-top: 2; margin-right: 0; margin-left: 0; margin-bottom: 0; background-image: url(bilder/background.gif); }
```

Head i index.php:

```
<link rel="stylesheet" href="inc/style.css" type="text/css">
```

Tills dess att det fungerar kommer jag att använda en include() för att få det på sidan, så kolla inte där :)

**r**: Upptäckte ett fel. Påverkade dock inte sidan  :(

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

## #12 — hypatia, 2002-01-19T12:49Z

Eftersom stilmallen ligger i underkatalogen inc, måste du ändra sökvägen till bilden i css-filen till ../bilder/background.gif.

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

## #13 — Viking, 2002-01-19T14:21Z

Måste jag? \*provar\*  :)

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

## #14 — Viking, 2002-01-19T14:24Z

Så, nu funkar det!  :) 

La style.css i samma katalog som index.php...

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

## #15 — hypatia, 2002-01-19T14:27Z

Vad bra att det fungerar nu! :D

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

## #16 — Viking, 2002-01-19T15:19Z

Japp!

Ser nu att den funkar bra i Mozilla, överaskning för mig!  :D

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

## #17 — frankof, 2002-01-19T17:36Z

Konstigt det där med att följa standard något sådär.
Plötsligen funkar det i nya petiga läsare ;)

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

## #18 — Viking, 2002-01-19T19:04Z

Hehe, den har nog funkat bra tidigare också, men jag har laddat ner Mozilla nu idag...  ;) 

Enligt  <http://validator.w3.org>  så hade jag bara ett fel, background, och det är borta nu...  :)

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

## #19 — hypatia, 2002-01-19T19:36Z

När du ändå håller på att ladda hem program, kan jag tipsa dig om [TopStyle](http://www.bradsoft.com/topstyle/download/index.asp) som är ett mycket trevligt program när man ska göra css-filer.

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

## #20 — Viking, 2002-01-19T20:11Z

Hur gillar det programmet PHP och HTML?  :)

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

---

Tråden på webben: https://www.webforum.nu/amne/html-css/1773-background  
Nästa sida: https://www.webforum.nu/amne/html-css/1773-background/page2.md
