CSS auslagern in eine Datei
Manuel
- css
Hi
Ich will meine styles in eine seperate Datei auslagern. Das funktioniert aber nicht. Was mach ich falsch?
in der HTML Datei:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Titel der Datei</title>
<link rel="stylesheet" type="text/css" href="css/background.css" media="screen">
</head>
<body>
<h3>Test</h3>
</body>
</html>
In der backround.css:
<head>
<style type="text/css">
/* Das ist ein Kommentar */
<!--
body{background-color:#797979;}
h3 {color:yellow;}
-->
</style>
</head>
Danke für euere Hilfe
cu
Manuel
In der backround.css:
/* Das ist ein Kommentar */
<!--
body{background-color:#797979;}
h3 {color:yellow;}
-->
Gruss damian
Hi,
In der backround.css:
<head>
<style type="text/css">/* Das ist ein Kommentar */
<!--
body{background-color:#797979;}
h3 {color:yellow;}
-->
</style>
</head>
Das ist keine css-Datei. Eine css-Datei enthält ausschließlich CSS-Anweisungen, also weder <head>, noch <style ...> noch <!-- o.ä..
Siehe z.B. SelfHTML-CSS-Datei
MfG
Rouven
Hallo Manuel,
In der backround.css:
<head>
<style type="text/css">/* Das ist ein Kommentar */
<!--
body { background-color:#797979; }
h3 { color:yellow; }
-->
</style>
</head>
Stylesheets sind keine HTML-Dateien und enthalten keine HTML-Elemente, sondern lediglich CSS-Deklarationen. Anhand deines Codes:
body { background-color:#797979; }
h3 { color:yellow; }
Mehr nicht, siehe Beispiel.
Grüße
Roland
Stylesheets sind keine HTML-Dateien und enthalten keine HTML-Elemente, sondern lediglich CSS-Deklarationen. Anhand deines Codes:
body { background-color:#797979; }
h3 { color:yellow; }
>
> Mehr nicht, siehe [Beispiel](http://de.selfhtml.org/css/formate/anzeige/selfhtmlcss.txt).
>
> Grüße
> Roland
>
Danke für die schnelle Hilfe!
Habs geändert leider ist Test immer noch nicht gelb!
Woran könnts noch liegen?
Thx
Manuel
'
Woran könnts noch liegen?
An einem blöden Tippsfehler!!
Thx
Manuel