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

Hi Monks, I want to chagne the font of my radio buttons using CSS.
print $q->checkbox_group( -name=>$CheckBoxName, -values=>\@ArrayData, -rows=>2 , -class=>'RadioButtons', -columns=>6, -onClick=>"document.$GLOB_FORM_FIELD_NAM +E.submit()");
this is my css part
.RadioButtons { color : Black; font-size: 15pt; font-family: arial; font-weight: bold; }
it isn't changing on my screen. Any ideas?

20050202 Edit by castaway: Changed title from 'Perl/CGI : Problems Using Css to change radio button fonts'

Replies are listed 'Best First'.
Re: (OT) Problems Using CSS to change radio button fonts
by Cody Pendant (Prior) on Feb 01, 2005 at 02:47 UTC
    OK first of all, almost to obvious to say, but are you talking about checkboxes or radiobuttons? Not strictly relevant to your question but if you're confused about something as basic as that, I'm a little concerned.

    Secondly, show us the HTML, it'll mean we don't have to render it ourselves! This isn't a Perl question at all, really...

    Thirdly, having rendered it myself, I can clearly see that this:

    <input type="checkbox" name="x" value="foo" class="RadioButtons" /> foo <input type="checkbox" name="x" value="bar" class="RadioButtons" /> bar <input type="checkbox" name="x" value="baz" class="RadioButtons" /> baz
    appears, or something like it. So the classes are attached to the buttons themselves, not the text which goes next to them. So your CSS has no effect on the text. Wrap the whole thing in a DIV instead.


    ($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss')
    =~y~b-v~a-z~s; print
Re: (OT) Problems Using CSS to change radio button fonts
by ww (Archbishop) on Jan 31, 2005 at 23:03 UTC