Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mixing font style in a drop down

0 views
Skip to first unread message

Nicolas Verhaeghe

unread,
Jun 21, 2009, 10:33:28 PM6/21/09
to
I have a request for a drop-down mixing font style. Basically, each
option item has to be in normal style, up to the middle where the
style needs to be italic.

For instance (in old school HTML):

Choice 1 - <i>legend 1</i>
Choice 2 - <i>legend 2</i>
Etc...

I believe this is something I can do with style sheets.

The platform is in VC# dot net (FW 3.5), by the way, but I can
probably get around that.

Thanks!

dorayme

unread,
Jun 21, 2009, 11:29:47 PM6/21/09
to
In article
<707bba3d-2555-4f69...@f30g2000vbf.googlegroups.com>,
Nicolas Verhaeghe <nic...@yahoo.com> wrote:

Without knowing what handles you might have to do otherwise, how about:

<ul><li>item 1
<ul>
<li>sub item 1</li>
<li>sub item 2</li>
<li>sub item 3</li>
<li class="halfwayAndMoreDown">sub item 4</li>
<li class="halfwayAndMoreDown">sub item 5</li>
<li class="halfwayAndMoreDown">sub item 6</li>
<li class="halfwayAndMoreDown">sub item 7</li>
<li class="halfwayAndMoreDown">sub item 8</li>
</ul></li>
</ul>

with a style of:

.halfwayAndMoreDown {font-style: italic}

--
dorayme

dorayme

unread,
Jun 21, 2009, 11:33:56 PM6/21/09
to
In article <doraymeRidThis-929...@news.albasani.net>,
dorayme <dorayme...@optusnet.com.au> wrote:

Oops, seems I can't type or count. Funny that because I am usually very
very good up to 8. Better than a crow I think.

<ul><li>item 1
<ul>
<li>sub item 1</li>
<li>sub item 2</li>
<li>sub item 3</li>

<li>sub item 4</li>

Nicolas Verhaeghe

unread,
Jun 22, 2009, 11:07:23 AM6/22/09
to
On Jun 21, 8:33 pm, dorayme <doraymeRidT...@optusnet.com.au> wrote:
> In article <doraymeRidThis-929BE1.13294722062...@news.albasani.net>,
>
>
>
>
>
>  dorayme <doraymeRidT...@optusnet.com.au> wrote:
> > In article
> > <707bba3d-2555-4f69-bf3e-07c867e46...@f30g2000vbf.googlegroups.com>,

Well, thanks, but what you are showing me is not a drop down, but a
list.

A drop down goes like this:

<select>
<option value="1">Choice 1 - Legend 1
<option value="2">Choice 2 - Legend 2
</select>

The idea here is to show "Choice n - " as normal, and "Legend n" as
italic.

Thanks!

Jeff

unread,
Jun 22, 2009, 11:11:26 AM6/22/09
to

It's exactly the same concept, just move the class from inside the li
tag to inside the ...


Jeff

Jukka K. Korpela

unread,
Jun 22, 2009, 11:58:23 AM6/22/09
to
Nicolas Verhaeghe wrote:

> I have a request for a drop-down mixing font style.

Drop-downs are rather often an inferior way of setting up a menu of choices,
as compared with radio buttons (or checkboxes).

> Basically, each
> option item has to be in normal style, up to the middle where the
> style needs to be italic.

This is somewhat questionable, especially since the default font for a
dropdown is typically a sans-serif font and authors usually don't set it to
a serif font. For sans-serif fonts, italics is not very prominent as
compared with normal font and might actually be "fake italics" (normal font
as slanted). The old typographic rule says that for emphasis you use bolding
for sans-serif, italics for serif.


>
> For instance (in old school HTML):
>
> Choice 1 - <i>legend 1</i>
> Choice 2 - <i>legend 2</i>
> Etc...

What has that got to do with drop-downs? An <option> element may not contain
any inner elements.

> I believe this is something I can do with style sheets.

In theory it is. You could set
<option class="special">foobar</option>
and use
option.special { font-style: italic; }
but IE (even IE 8) doesn't support it. This would bring us back to the idea
of using a set of radio buttons. That way you could italicize the text you
like, even in HTML if desired.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Adrienne Boswell

unread,
Jun 22, 2009, 12:15:22 PM6/22/09
to
Gazing into my crystal ball I observed "Jukka K. Korpela"
<jkor...@cs.tut.fi> writing in
news:JUN%l.16028$vi5....@uutiset.elisa.fi:

>> I have a request for a drop-down mixing font style.
>
> Drop-downs are rather often an inferior way of setting up a menu of
> choices, as compared with radio buttons (or checkboxes).
>
>> Basically, each
>> option item has to be in normal style, up to the middle where the
>> style needs to be italic.
>

I wonder if the OP is looking for OptGroup, eg:

<select name="something">
<option value="">Pick Somthing</option>
<optgroup label="First Choices">
<option value="a">a</option>
<option value="b">b</option>
</optgroup>
<optgroup label="Second Choices">
<option value="c">c</option>
<option value="d">d</option>
</optgroup>
</select>

The optgroup element does appear in bold italic, so maybe that's what the
OP _really_ wants.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Jukka K. Korpela

unread,
Jun 22, 2009, 1:03:06 PM6/22/09
to
Adrienne Boswell wrote:

> The optgroup element does appear in bold italic, so maybe that's what
> the OP _really_ wants.

Well, who knows, especially in the absence of a URL?

The default rendering of an optgroup element is not specified in HTML
specifications, and the "default style sheet for HTML 4" in CSS specs
doesn't say anything about it either. So the common rendering, bold italic,
is just coincidental and may well change in future browsers.

Funnily enough, if you use optgroup, then IE won't let you turn _off_ the
italics or the bolding using CSS.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Jonathan N. Little

unread,
Jun 22, 2009, 2:54:10 PM6/22/09
to
Jukka K. Korpela wrote:

> Funnily enough, if you use optgroup, then IE won't let you turn _off_
> the italics or the bolding using CSS.

IE, all flavors, is such a cantankerous inflexible creature and such a
"delight" for web authors!

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Nicolas Verhaeghe

unread,
Jun 22, 2009, 4:24:33 PM6/22/09
to
Adrienne, no in this case it is nothing about optgroup.

Also using a line item is not what my client requires in this case.
The drop down is also populated in code behind from a data source, and
this is relatively rigid at this point. There is also a need for
consistency with the other drop downs.

This drop down has about 70+ choices, so radio buttons would not work.
And yes, 70+ is a lot, but this what the client wants.

I could code my own web control to accommodate this request if I find
the best option for this.

Each item in the drop down has to mix two font styles, on the same
line, basically.

I'll dig a bit into this for a while, but I already told the client
this would be a bit more work, meaning a bit more money to spend, so I
expect them to drop the ball on this diva request.

Thanks for the help

On Jun 22, 9:15 am, Adrienne Boswell <arb...@yahoo.com> wrote:
> Gazing into my crystal ball I observed "Jukka K. Korpela"

> <jkorp...@cs.tut.fi> writing innews:JUN%l.16028$vi5....@uutiset.elisa.fi:


>
> >> I have a request for a drop-down mixing font style.
>
> > Drop-downs are rather often an inferior way of setting up a menu of
> > choices, as compared with radio buttons (or checkboxes).
>
> >> Basically, each
> >> option item has to be in normal style, up to the middle where the
> >> style needs to be italic.
>
> I wonder if the OP is looking for OptGroup, eg:
>
> <select name="something">
> <option value="">Pick Somthing</option>
> <optgroup label="First Choices">
> <option value="a">a</option>
> <option value="b">b</option>
> </optgroup>
> <optgroup label="Second Choices">
> <option value="c">c</option>
> <option value="d">d</option>
> </optgroup>
> </select>
>
> The optgroup element does appear in bold italic, so maybe that's what the
> OP _really_ wants.
>
> --
> Adrienne Boswell at Home

> Arbpen Web Site Design Serviceshttp://www.cavalcade-of-coding.info

Ben C

unread,
Jun 22, 2009, 4:34:18 PM6/22/09
to
On 2009-06-22, Jonathan N. Little <lws...@centralva.net> wrote:
> Jukka K. Korpela wrote:
>
>> Funnily enough, if you use optgroup, then IE won't let you turn _off_
>> the italics or the bolding using CSS.
>
> IE, all flavors, is such a cantankerous inflexible creature and such a
> "delight" for web authors!

To be fair to IE, you shouldn't expect to be able to style optgroup. It
says in the CSS spec somewhere that any support you get in a browser for
styling replaced UI thingies should be regarded as experimental.

Here it is (in 3.2):

CSS 2.1 does not define which properties apply to form controls and
frames, or how CSS can be used to style them. User agents may apply
CSS properties to these elements. Authors are recommended to treat
such support as experimental. A future level of CSS may specify this
further.

Jukka K. Korpela

unread,
Jun 22, 2009, 4:42:21 PM6/22/09
to
Nicolas Verhaeghe wrote:

> This drop down has about 70+ choices, so radio buttons would not work.

What makes you think so?

> And yes, 70+ is a lot, but this what the client wants.

If 70+ options would be reasonable, what would be unreasonable with 70+
radio buttons? It's a professional's responsibility to tell the client that
the approach is wrong, instead of asking others to implement it.

> Each item in the drop down has to mix two font styles, on the same
> line, basically.

Basically, you are asking for something logically impossible.

> I'll dig a bit into this for a while, but I already told the client
> this would be a bit more work,

That's wrong information. You should have told that you don't know whether
it is possible (or that it is not possible).

> On Jun 22, 9:15 am, Adrienne Boswell <arb...@yahoo.com> wrote:

Upside-down fullquoting ranks you as a fairly clueless Usenet poster, to be
honest.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Jonathan N. Little

unread,
Jun 22, 2009, 6:10:25 PM6/22/09
to

True, if only experimental features of CSS were the only source of blue
language when dealing with IE

dorayme

unread,
Jun 22, 2009, 6:38:18 PM6/22/09
to
In article
<423e1b69-5081-4968...@x31g2000prc.googlegroups.com>,
Nicolas Verhaeghe <nic...@yahoo.com> wrote:

> On Jun 21, 8:33 pm, dorayme <doraymeRidT...@optusnet.com.au> wrote:
> > In article <doraymeRidThis-929BE1.13294722062...@news.albasani.net>,

...

> Well, thanks, but what you are showing me is not a drop down, but a
> list.
>

Misunderstanding on my part, I was showing you a way with a drop down
menu made with lists.

--
dorayme

Adrienne Boswell

unread,
Jun 23, 2009, 1:27:48 PM6/23/09
to
Gazing into my crystal ball I observed Nicolas Verhaeghe
<nic...@yahoo.com> writing in
news:3f52580b-92d1-4003...@x31g2000prc.googlegroups.com:

Please don't top post. Post corrected, see bottom.

> On Jun 22, 9:15�am, Adrienne Boswell <arb...@yahoo.com> wrote:
>> Gazing into my crystal ball I observed "Jukka K. Korpela"
>> <jkorp...@cs.tut.fi> writing
>> innews:JUN%l.16028$vi5....@uutiset.elisa.fi
>:
>>
>> >> I have a request for a drop-down mixing font style.
>>
>> > Drop-downs are rather often an inferior way of setting up a menu of
>> > choices, as compared with radio buttons (or checkboxes).
>>
>> >> Basically, each
>> >> option item has to be in normal style, up to the middle where the
>> >> style needs to be italic.
>>
>> I wonder if the OP is looking for OptGroup, eg:
>>
>> <select name="something">
>> <option value="">Pick Somthing</option>
>> <optgroup label="First Choices">
>> <option value="a">a</option>
>> <option value="b">b</option>
>> </optgroup>
>> <optgroup label="Second Choices">
>> <option value="c">c</option>
>> <option value="d">d</option>
>> </optgroup>
>> </select>
>>
>> The optgroup element does appear in bold italic, so maybe that's what
>> the OP _really_ wants.
>>

> Adrienne, no in this case it is nothing about optgroup.


>
> Also using a line item is not what my client requires in this case.
> The drop down is also populated in code behind from a data source, and
> this is relatively rigid at this point. There is also a need for
> consistency with the other drop downs.

URL? It might help if you give us one, and then we might have some ideas
that could give you other options.

>
> This drop down has about 70+ choices, so radio buttons would not work.
> And yes, 70+ is a lot, but this what the client wants.

Tell the client to stop wanting that. Seriously. IIRC, there are some
browsers that will max out at a certain amount of options. I seem to
remember a post about that over at
microsoft.public.inetserver.asp.general. If that's the case, then you
HAVE to do something else.

>
> I could code my own web control to accommodate this request if I find
> the best option for this.
>
> Each item in the drop down has to mix two font styles, on the same
> line, basically.

Ah ha! So you want to do something like:

<select name="field">
<% list = array("something","anything","nothing")
things = array("other","mine","yours")

for i = 0 to ubound(list)
%>
<option value="<%=i%>"><%=list(i)%><span class="myclass"><%=things(i)%>
</span></option>
<% next%>
</select>

Sorry, it's not going to work. There just isn't browser support for it
right now. Even if you _could_ find a browser that would do it
correctly, you would still have to deal with IE.

>
> I'll dig a bit into this for a while, but I already told the client
> this would be a bit more work, meaning a bit more money to spend, so I
> expect them to drop the ball on this diva request.
>
> Thanks for the help
>

If some browsers stop rendering at a certain amount of options, then your
diva doesn't have enough money - unless she wants to hire someone to
develop a new browser, and then hire hit men to make sure everyone uses
it.

GTalbot

unread,
Jun 23, 2009, 2:41:56 PM6/23/09
to
On 22 juin, 14:54, "Jonathan N. Little" <lws4...@centralva.net> wrote:
> Jukka K. Korpela wrote:
> > Funnily enough, if you use optgroup, then IE won't let you turn _off_
> > the italics or the bolding using CSS.
>
> IE, all flavors, is such a cantankerous inflexible creature and such a
> "delight" for web authors!

"CSS 2.1 does not define which properties apply to form controls and


frames, or how CSS can be used to style them. User agents may apply
CSS properties to these elements. Authors are recommended to treat
such support as experimental. A future level of CSS may specify this
further."

CSS 2.1, section 3.2 UA Conformance
http://www.w3.org/TR/CSS21/conform.html

regards, Gérard
--
Internet Explorer 7 bugs: 175 bugs so far
http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/
Internet Explorer 8 bugs: 49 bugs so far
http://www.gtalbot.org/BrowserBugsSection/MSIE8Bugs/

0 new messages