Janek Schleicher wrote:

> Jimmy George wrote at Fri, 27 Sep 2002 00:36:42 +0200:
> 
>> When we use commands such as
>> 
>> $q->p("some line of text");
>> 
>> when doing prints, is there any way of giving the output attributes such
>> as we can  with css descriptors?
> 
> e.g.
> $q->p({-style => 'color: red; font-size: 24pt'},
>       "some line of text");
> 
> Read the section
> LIMITED SUPPORT FOR CASCADING STYLE SHEETS
> from
> perldoc CGI
> for details
> 

Just to add to the thread, any -name=>'value' pair set in a hash ref passed 
as the first argument to a CGI object's html generating methods will be 
translated into tag attributes and values.

[trwww@devel_rh trwww]$ perl -MCGI -e '$q=new CGI; print(
$q->div({-width=>"75%",-class=>"divClass",-style=>"align: 
right;",-foo=>"bar"}, "Hello world"), "\n");'

<div class="divClass" width="75%" foo="bar" style="align: right;">Hello 
world</div>

Todd W.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to