HighDots Forums  

Mixing font style in a drop down

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Mixing font style in a drop down in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Nicolas Verhaeghe
 
Posts: n/a

Default Mixing font style in a drop down - 06-21-2009 , 10:33 PM






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!

Reply With Quote
  #2  
Old   
dorayme
 
Posts: n/a

Default Re: Mixing font style in a drop down - 06-21-2009 , 11:29 PM






In article
<707bba3d-2555-4f69-bf3e-07c867e4647d (AT) f30g2000vbf (DOT) googlegroups.com>,
Nicolas Verhaeghe <nicver (AT) yahoo (DOT) com> wrote:

Quote:
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!
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

Reply With Quote
  #3  
Old   
dorayme
 
Posts: n/a

Default Re: Mixing font style in a drop down - 06-21-2009 , 11:33 PM



In article <doraymeRidThis-929BE1.13294722062009 (AT) news (DOT) albasani.net>,
dorayme <doraymeRidThis (AT) optusnet (DOT) com.au> wrote:

Quote:
In article
707bba3d-2555-4f69-bf3e-07c867e4647d...oglegroups.com>,
Nicolas Verhaeghe <nicver (AT) yahoo (DOT) com> wrote:

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!

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}
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>
<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

Reply With Quote
  #4  
Old   
Nicolas Verhaeghe
 
Posts: n/a

Default Re: Mixing font style in a drop down - 06-22-2009 , 11:07 AM



On Jun 21, 8:33*pm, dorayme <doraymeRidT... (AT) optusnet (DOT) com.au> wrote:
Quote:
In article <doraymeRidThis-929BE1.13294722062... (AT) news (DOT) albasani.net>,





*dorayme <doraymeRidT... (AT) optusnet (DOT) com.au> wrote:
In article
707bba3d-2555-4f69-bf3e-07c867e46... (AT) f30g2000vbf (DOT) googlegroups.com>,
*Nicolas Verhaeghe <nic... (AT) yahoo (DOT) com> wrote:

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!

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}

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
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
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!

Reply With Quote
  #5  
Old   
Jeff
 
Posts: n/a

Default Re: Mixing font style in a drop down - 06-22-2009 , 11:11 AM



Nicolas Verhaeghe wrote:
Quote:
On Jun 21, 8:33 pm, dorayme <doraymeRidT... (AT) optusnet (DOT) com.au> wrote:
In article <doraymeRidThis-929BE1.13294722062... (AT) news (DOT) albasani.net>,





dorayme <doraymeRidT... (AT) optusnet (DOT) com.au> wrote:
In article
707bba3d-2555-4f69-bf3e-07c867e46... (AT) f30g2000vbf (DOT) googlegroups.com>,
Nicolas Verhaeghe <nic... (AT) yahoo (DOT) com> wrote:
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!
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}
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
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

Well, thanks, but what you are showing me is not a drop down, but a
list.
It's exactly the same concept, just move the class from inside the li
tag to inside the ...


Jeff
Quote:
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!

Reply With Quote
  #6  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Mixing font style in a drop down - 06-22-2009 , 11:58 AM



Nicolas Verhaeghe wrote:

Quote:
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).

Quote:
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.
Quote:
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.

Quote:
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/

Reply With Quote
  #7  
Old   
Adrienne Boswell
 
Posts: n/a

Default Re: Mixing font style in a drop down - 06-22-2009 , 12:15 PM



Gazing into my crystal ball I observed "Jukka K. Korpela"
<jkorpela (AT) cs (DOT) tut.fi> writing in
news:JUN%l.16028$vi5.8198 (AT) uutiset (DOT) elisa.fi:

Quote:
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

Reply With Quote
  #8  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Mixing font style in a drop down - 06-22-2009 , 01:03 PM



Adrienne Boswell wrote:

Quote:
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/

Reply With Quote
  #9  
Old   
Jonathan N. Little
 
Posts: n/a

Default Re: Mixing font style in a drop down - 06-22-2009 , 02:54 PM



Jukka K. Korpela wrote:

Quote:
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

Reply With Quote
  #10  
Old   
Nicolas Verhaeghe
 
Posts: n/a

Default Re: Mixing font style in a drop down - 06-22-2009 , 04:24 PM



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... (AT) yahoo (DOT) com> wrote:
Quote:
Gazing into my crystal ball I observed "Jukka K. Korpela"
jkorp... (AT) cs (DOT) tut.fi> writing innews:JUN%l.16028$vi5.8198 (AT) uutiset (DOT) 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
Please respond to the group so others can share

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.