in reply to HTML Tag attribute problems with CGI.pm

The HTML syntax has no real way of loading a background image directly, for this you need to use style-sheets.

The answer is

$c = CGI->new(); push @page, $c->header; push @page, $c->start_html( -style=>{-src=>'/style/st1.css'}) ... yada ...

and in the file ..../style/st1.css you include the contents:

BODY {background-image: /dir/image.png}

This is untested. I'm sitting in someone elses house, so doing this from memory. If neccessary, look at the www.w3c.org web site for details on stylesheets

-- Ian Stuart
A man depriving some poor village, somewhere, of a first-class idiot.

Replies are listed 'Best First'.
Re: Re: cgi.pm problem
by shotgunefx (Parson) on May 30, 2001 at 22:03 UTC
    You don't have to use a stylesheet, you can just specify the url to use in start_html().
    start_html(-background=>'http://somewhere.com/img.gif');


    -Lee

    "To be civilized is to deny one's nature."