CGI and CSS question

P

perlUSER

Hello,
I am writing a Perl script using CGI and CSS for my home page. The out
put from the script looks good except the hover doesn't work when I
point my cursor on the clickable item.
I am using an external file to code the fonts and formats. Basically
the style sheet is effective on the fonts but not on the hover. Could
someone please tell me how to make this work?

Thanks in advance,
Sri.
 
J

J. Gleixner

perlUSER said:
Hello,
I am writing a Perl script using CGI and CSS for my home page. The out
put from the script looks good except the hover doesn't work when I
point my cursor on the clickable item.
I am using an external file to code the fonts and formats. Basically
the style sheet is effective on the fonts but not on the hover. Could
someone please tell me how to make this work?

Code it correctly and it will work. This isn't the newsgroup for "Why
doesn't my HTML/Javascript work."
 
P

Paul Lalli

perlUSER said:
I am writing a Perl script using CGI and CSS for my home page. The out
put from the script looks good except the hover doesn't work when I
point my cursor on the clickable item.
I am using an external file to code the fonts and formats. Basically
the style sheet is effective on the fonts but not on the hover. Could
someone please tell me how to make this work?

Perl is the language you used to produce your output. It is your
output that is faulty. This has nothing to do with Perl. Your problem
would be the same if you generated your output in C, Lisp, Java, or any
other language.

Find a group that actually has anything to do with CSS, and ask there.
When you do, you might want to tell them what your output looks like,
rather than just telling them it doesn't work and asking them to fix
it.

Paul Lalli
 
P

perlUSER

Paul said:
Perl is the language you used to produce your output. It is your
output that is faulty. This has nothing to do with Perl. Your problem
would be the same if you generated your output in C, Lisp, Java, or any
other language.

Find a group that actually has anything to do with CSS, and ask there.
When you do, you might want to tell them what your output looks like,
rather than just telling them it doesn't work and asking them to fix
it.

Paul Lalli

Sorry guys if I have posted this to a wrong group. I think I have
figured it out why.

The following lines are appearing in the output. I removed these lines
from the html page I have generated and I like what I see.

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Question is how can I tell my CGI/Perl not to write the above three
liens?

Thanks.
 
B

Bart Van der Donck

perlUSER said:
The following lines are appearing in the output. I removed these lines
from the html page I have generated and I like what I see.

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Question is how can I tell my CGI/Perl not to write the above three
liens?

Well uhm, like you said, by removing it from the HTML output :) The
script will not print anything you don't ask for.

Here is an example that should help you further.

yourfile.pl

#!/usr/bin/perl
print "Content-Type: text/html; charset=iso-8859-1\n\n";
use strict;
use warnings;
use CGI::Carp qw(fatalsToBrowser);
print <<HTML;
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="http://www.mysite.com/mystyle.css"
type="text/css" media="all">
</head>
<body>
<a href="http://www.google.com/">Google</a>
</body>
</html>
HTML

This be http://www.mysite.com/mystyle.css

a:link { color:blue; }
a:visited { color:purple; }
a:hover { color:red; }
a:active { color:eek:range; }
 
P

perlUSER

Bart said:
Well uhm, like you said, by removing it from the HTML output :) The
script will not print anything you don't ask for.

Here is an example that should help you further.


Thank you.
 
G

Glenn Jackman

At 2006-03-31 12:02PM said:
The following lines are appearing in the output. I removed these lines
from the html page I have generated and I like what I see.

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Question is how can I tell my CGI/Perl not to write the above three
liens?

Try:
use CGI qw:)standard -no_xhtml);

If you don't want the doctype at all, don't call start_html() -- print
your own head and body tags.
 
A

A. Sinan Unur

Well uhm, like you said, by removing it from the HTML output :) The
script will not print anything you don't ask for.

Here is an example that should help you further.

yourfile.pl

#!/usr/bin/perl
print "Content-Type: text/html; charset=iso-8859-1\n\n";
use strict;
use warnings;
use CGI::Carp qw(fatalsToBrowser);
print <<HTML;
<html>

But but but ... browsers decide whether to run in standards compliant
mode versus quirks mode based on the existence of a proper DOCTYPE (not
that this has anything to do with Perl). So, if the stylesheet does not
work with the proper DOCTYPE, there is something wrong with either the
HTML or the CSS.

Sinan
--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
 
B

Bart Van der Donck

A. Sinan Unur said:
But but but ... browsers decide whether to run in standards compliant
mode versus quirks mode based on the existence of a proper DOCTYPE (not
that this has anything to do with Perl). So, if the stylesheet does not
work with the proper DOCTYPE, there is something wrong with either the
HTML or the CSS.

Could you name such a case where a stylesheet doesn't work with a given
DOCTYPE ?

Thanks
 
A

A. Sinan Unur

Could you name such a case where a stylesheet doesn't work with a
given DOCTYPE ?

Off the top of my head, no.

However, I based my statement on the following observations:

1) Proper DOCTYPE puts browsers in standards compliant mode.

2) Lack of a DOCTYPE puts them in quirks mode where browsers use
different rules for rendering

3) The OP got what he wanted when he switched he got rid of the DOCTYPE;
i.e. switched the browser from standards compliant mode to quirks mode.

Therefore, my conclusion that there must be something non standards
compliant in his HTML.

So, an example might have been the OP's CSS and HTML. Plainly it "didn't
work" with a DOCTYPE.

Sinan
--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
 
B

Bart Van der Donck

A. Sinan Unur said:
Off the top of my head, no.

I think there aren't any. (as long as we're talking about (X)HTML)
However, I based my statement on the following
observations:
1) Proper DOCTYPE puts browsers in standards
compliant mode.

Ideally and theoretically, yes. But you can't rely on that in practice.
2) Lack of a DOCTYPE puts them in quirks mode
where browsers use different rules for rendering

Correct, per defition.
3) The OP got what he wanted when he switched he
got rid of the DOCTYPE; i.e. switched the browser
from standards compliant mode to quirks mode.

Then I think the OP gave the wrong information. There must be another
reason why his CSS didn't work.
 
E

Eric Bohlman

However, I based my statement on the following observations:

1) Proper DOCTYPE puts browsers in standards compliant mode.

Generally that has to be the STRICT doctype. The TRANSITIONAL doctype,
which the OP was sending out, activates quirks mode.
Therefore, my conclusion that there must be something non standards
compliant in his HTML.

My conclusion would be that there was something in his CSS that relied on a
correct interpretation of the CSS box model or something similar, but his
TRANSITIONAL doctype was triggering quirks mode, causing the browser to
emulate the incorrect behavior of early versions of MSIE.
 
A

A. Sinan Unur

Generally that has to be the STRICT doctype. The TRANSITIONAL
doctype, which the OP was sending out, activates quirks mode.

It seems like I generalized based on what I observed in Firefox. Reality,
as usual, seems to be more complicated.

http://hsivonen.iki.fi/doctype/

Sinan
--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
 
T

Todd

perlUSER said:
Sorry guys if I have posted this to a wrong group. I think I have
figured it out why.

The following lines are appearing in the output. I removed these lines
from the html page I have generated and I like what I see.

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Question is how can I tell my CGI/Perl not to write the above three
liens?

Thanks.

What you can do is use FireFox with the "HTML Validator" extension to
verify your Perl is creating properly formed HTML. It gives you a
little box in the lower right corner of your browser. Clicking this
shows the HTML source with all of your errors, and you can fix your Perl
accordingly. This will greatly help you write W3C compliant code.


Todd

http://www.mozilla.com/firefox/
https://addons.mozilla.org/extensio...efox&category=Developer Tools&numpg=10&id=249
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top