Question about a <b> in the inner text of a label

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • johngilmer@yahoo.com

    Question about a <b> in the inner text of a label

    I have three radio buttons that are possible answers to a question. I
    have put them in a table and there is a label that goes with each radio
    button as its text. I would like to make some of the text of the label
    bold, so I have put <b> tags around the text I want bold. But it
    doesn't work; the text that should be bold is just regular. Any ideas
    would be appreciated. Thanks in advance. Here is the html:

    <table id="ANSWERS_4" border="0"
    style="color:#0 03366;font-family:Arial;fo nt-size:12pt;">
    <tr>
    <td>
    <input id="ANSWERS_4_0 " type="radio" value="A" />
    <label for="ANSWERS_4_ 0"><b>This text is bold</b> 200 mg/dL</label>
    </td>
    </tr>
    <tr>
    <td>
    <input id="ANSWERS_4_1 " type="radio" value="B" />
    <label for="ANSWERS_4_ 1">350 mg/dL</label>
    </td>
    </tr>
    </table>

  • Jukka K. Korpela

    #2
    Re: Question about a &lt;b&gt; in the inner text of a label

    johngilmer@yaho o.com wrote:
    [color=blue]
    > I have three radio buttons that are possible answers to a question.[/color]

    The sample you posted has just two. It often happens that when people
    post just an excerpt of code, they inadvertantly modify it in a manner
    that prevents proper analysis of the problem, or omit a relevant part.
    To put it simply: post the URL
    [color=blue]
    > I have put them in a table and there is a label that goes with each
    > radio button as its text.[/color]

    OK, though I don't see a particular reason to use a table - you have
    just one cell per row.
    [color=blue]
    > I would like to make some of the text of
    > the label bold, so I have put <b> tags around the text I want bold.[/color]

    Why? The <b> markup says 'I'd like to have this bold, but I can't say
    why'. If it is for emphasis, <strong> is more logical. Either way, no
    problem - you can use text-level markup inside a label element.
    [color=blue]
    > But it doesn't work; the text that should be bold is just regular.[/color]

    Your excerpt is displayed with the desired text in bold
    on IE 6 and Mozilla on my system.

    Please post the URL, and identify the browser(s) you tested.
    [color=blue]
    > <table id="ANSWERS_4" border="0"
    > style="color:#0 03366;font-family:Arial;fo nt-size:12pt;">[/color]

    Bad CSS: you should always set background when you set color, and
    you should not set a fixed font size. The size 12pt is too big to many,
    too small to many.
    [color=blue]
    > <input id="ANSWERS_4_0 " type="radio" value="A" />[/color]

    Your input elements lack the name attribute, without which they are
    useless.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

    Comment

    Working...