CyCo
10-13-2003, 10:38 AM
Below you will find an example that will output simple HTML. My question can be found at the bottom of the script.
#!/usr/bin/perl
use strict;
use CGI;
my $q = CGI->new();
print $q->header,
$q->start_html( -title => "Hello",
-style => "body { font-family:verdana, arial, helvetica; }
h2 { font-size:125%; }",
-onload => "alert('Thanx for running this example')" ),
$q->h2( "Hello, Web Developer Forums Members" ),
$q->p( "I'm having trouble with the correct syntax for adding the following line:" ),
$q->p( "<link href=\"./css/styles.css\" rel=\"stylesheet\" type=\"text/css\">" ),
$q->p( "I can't seem to recall...I've searched for the answer...but, no luck" ),
$q->p( $q->a({ -href => "mailto:webmaster\@cycocity.com",
-style => "text-decoration:none;",
-title => "webmaster\@cycocity.com" }, "CyCo" )),
$q->end_html;
# #
# What is the correct syntax for adding the line below to the above example? #
# #
# <link href="./css/styles.css" rel="stylesheet" type="text/css"> #
# #
# I've tried every combination I could think of. Basically, I'm trying to #
# incorporate a style sheet, instead of directly adding each style's #
# attribute in the head of the document. Using standard syntax is NOT an #
# issue, it's the "object-oriented" syntax that's throwing me. Can someone #
# please shed some light on this? #
# #
# Thanx!, #
# CyCo #
# #
#!/usr/bin/perl
use strict;
use CGI;
my $q = CGI->new();
print $q->header,
$q->start_html( -title => "Hello",
-style => "body { font-family:verdana, arial, helvetica; }
h2 { font-size:125%; }",
-onload => "alert('Thanx for running this example')" ),
$q->h2( "Hello, Web Developer Forums Members" ),
$q->p( "I'm having trouble with the correct syntax for adding the following line:" ),
$q->p( "<link href=\"./css/styles.css\" rel=\"stylesheet\" type=\"text/css\">" ),
$q->p( "I can't seem to recall...I've searched for the answer...but, no luck" ),
$q->p( $q->a({ -href => "mailto:webmaster\@cycocity.com",
-style => "text-decoration:none;",
-title => "webmaster\@cycocity.com" }, "CyCo" )),
$q->end_html;
# #
# What is the correct syntax for adding the line below to the above example? #
# #
# <link href="./css/styles.css" rel="stylesheet" type="text/css"> #
# #
# I've tried every combination I could think of. Basically, I'm trying to #
# incorporate a style sheet, instead of directly adding each style's #
# attribute in the head of the document. Using standard syntax is NOT an #
# issue, it's the "object-oriented" syntax that's throwing me. Can someone #
# please shed some light on this? #
# #
# Thanx!, #
# CyCo #
# #