Thread CSS wird ignoriert (18 answers)
Opened by AndiE at 2011-08-29 12:12

AndiE
 2011-08-28 20:26
#151894 #151894
User since
2010-10-24
65 Artikel
BenutzerIn
[default_avatar]
Hallo,

ich habe ein ähnliches Problem. Darum häne ich mich hier mal dran.

CGI_Script
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/perl -w

use CGI;

my $q=CGI->new;

print $q->header();
print $q->start_html(-style=>{-src=>'style.css'});
print $q->h1({-class=>'Test'},'Hallo');
print $q->a({-href=>'env.cgi'},'Umgebung');
print $q->end_html();

2. CSS- Datei „style.css“
Code: (dl )
1
2
3
4
H1.Test
{
color: green;
}

3. Ausgabe des CGI-Scriptes
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<h1 class="Test">Hallo</h1><a href="env.cgi">Umgebung</a>
</body>
</html>


Das Problem ist, dass der "H1"- Inhalt trotzdem nicht grün angezeigt wird.
Das Ganze läuft lokal und auch "http://localhost/cgi-bin/style.css" oder auch "http://localhost/style.css" haben nichts gebracht.( ich habe in das htdocs-Verzeichnis kopiert.

Kann es mit der "eingeschränkten Unterstützung für CSS"(Wortlaut in der CGI- Datei) zu tun haben?

Splitted from CSS wird ignoriert msg #148268
Last edited: 2011-08-29 12:12:23 +0200 (CEST)

View full thread CSS wird ignoriert