ana711 has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: html css how to use with cgi perl
by b10m (Vicar) on Dec 30, 2004 at 10:22 UTC

    As Anonymous Monk already pointed out, the answers are all in Html Template CSS and CGI PERL

    I would like to comment on your template though, for you have quite a few errors in there (small as it is):

    <html> <head> <center><h2>Registration Form</h2></center> <title> Registration</title> <body> <p>my text goes here. </body> </html>

    First of all, please, oh please remember to close your tags. head and p aren't, providing you with your next problem, the <center><h2>Registration Form</h2></center> within your head block.

    Secondly, if you want to use CSS, you might aswell get rid of the <center> tags... (h2 { text-align: center; })

    Rewritten template:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="/path/to/your.css" /> <title>Registration</title> </head> <body> <h2>Registration Form</h2> <p>my text goes here.</p> </body> </html>
    --
    b10m

    All code is usually tested, but rarely trusted.
Re: html css how to use with cgi perl
by chromatic (Archbishop) on Dec 30, 2004 at 08:26 UTC

    Put your CSS file in a normal directory under your docroot somewhere -- your templates directory may not be accessible to clients.

    Add a link to the stylesheet in the head of your HTML template. I use something like:

    <head> <title>Registration</title> <link rel="stylesheet" type="text/css" href="/css/Format.css" title="D +efault" /> </head> <body> ... body as normal ... </body>

    Treat it as you would another HTML page, an image, or anything else you link to. The fact of your generating this through Perl makes no difference in anything but relative links to the CSS file.

Re: html css how to use with cgi perl
by Anonymous Monk on Dec 30, 2004 at 08:29 UTC
Re: html css how to use with cgi perl
by Anonymous Monk on Dec 30, 2004 at 08:28 UTC