---
title: "kommentar i en css-fil?"
type: "forum-thread"
url: "https://www.webforum.nu/amne/html-css/1146-kommentar-i-en-css-fil"
topic: "HTML & CSS"
topic_url: "https://www.webforum.nu/amne/html-css"
author: "trensare"
published: "2001-05-31T13:01:00.000Z"
updated: "2001-05-31T16:12:00.000Z"
replies: 5
views: 409
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/1146-kommentar-i-en-css-fil"
---

# kommentar i en css-fil?

## #1 — trensare, 2001-05-31T13:01Z

Hur skrivar man... eller går det överhuvudtaget. Kör med vanliga html-kommentarer o det verkar funka, men kan det bli problem?

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

## #2 — Erik Juhlin, 2001-05-31T13:04Z

Jag tror det kan bli problem. Och har man en inkluderad CSS-fil så funkar det inte. Då är det bättre med:

```
/* Detta är en kommentar */
```

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

## #3 — trensare, 2001-05-31T13:47Z

Japp. Det är en includerad css

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

## #4 — trensare, 2001-05-31T13:49Z

Alltså...

\<STYLE TYPE="TEXT/CSS"\>
\<!--
A:link { text-decoration: none; color: #666666 }
A:visited { text-decoration: none; color: #666666 }
A:active { text-decoration: none; underline: #000000 }
A:hover { text-decoration: none; color: #000000 }
A.type1:link    { color:#FFFFFF; text-decoration:none; }
A.type1:visited { color:#FFFFFF; text-decoration:none; }
A.type1:active  { color:#FFFFFF; text-decoration:none; }
A.type1:hover   { color:#FFFFFF; text-decoration:overline underline; }
\--\>
\</STYLE\>

/\* kommentaren här \*/

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

## #5 — Jojoxx, 2001-05-31T14:17Z

CSS-filen skall inte innehålla några element (taggar)

filnamn.css

```
A:link { text-decoration: none; color: #666666 }
A:visited { text-decoration: none; color: #666666 }
A:active { text-decoration: none; underline: #000000 }
A:hover { text-decoration: none; color: #000000 }
A.type1:link { color:#FFFFFF; text-decoration:none; }
A.type1:visited { color:#FFFFFF; text-decoration:none; }
A.type1:active { color:#FFFFFF; text-decoration:none; }
A.type1:hover { color:#FFFFFF; text-decoration:overline underline; }
/* och en liten kommentar */
```

Däremot tillåter [standarden](http://www.w3.org/TR/REC-CSS2/syndata.html#x24) html-kommentarer: \<!-- ... --\> för att gömma CSS-koden i gamla webbläsare, men de fyller ingen funktion som kommentarsavgränsare.

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

## #6 — trensare, 2001-05-31T16:12Z

ok. Tack för hjälpen!

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

---

Tråden på webben: https://www.webforum.nu/amne/html-css/1146-kommentar-i-en-css-fil
