Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Color in a Pull-Down Menu

Reply
Thread Tools

Color in a Pull-Down Menu

 
 
Dennis M. Marks
Guest
Posts: n/a
 
      11-28-2003
Can there be different colors for words on a pull-down menu either on
the same or different lines?

red blue
red blue
red blue
etc

or

red
red
blue
red
blue
etc

--
Dennis M. Marks


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
 
Reply With Quote
 
 
 
 
Disco Octopus
Guest
Posts: n/a
 
      11-28-2003
Dennis M. Marks wrote:
> Can there be different colors for words on a pull-down menu either on
> the same or different lines?
>

what do you mean by 'dropdown menu'? do you mean this....

<select>
<option value="1" style="background-color:blue;">one</option>
<option value="2" style="background-color:red;">two</option>
</select>


i am sure sure if this will work in many browsers, but it works in IE5.5 and
NS 7.1, and it does not work in Opera 7.1



 
Reply With Quote
 
 
 
 
Leif K-Brooks
Guest
Posts: n/a
 
      11-28-2003
Dennis M. Marks wrote:
> Can there be different colors for words on a pull-down menu either on
> the same or different lines?


Pull-down menu created with a <select>? Pure CSS? CSS and Javascript?

 
Reply With Quote
 
Dennis M. Marks
Guest
Posts: n/a
 
      11-28-2003
<SELECT etc>
<OPTION etc>
<OPTION etc>
</SELECT>

Yes, either or both. Just looking for options to play around with. They
only have to work in IE, but it would be nice to work in others. If you
go to my web site http://www.dcs-chico.com/~denmarks/ and go to the
Amtrak page you will see a list of trains (first pull-down menu). I
would like the cities to be a different color than the trains. Some of
the lines are for discontinued trains. I would like them to be another
color.

In article <xeAxb.174$(E-Mail Removed)>, Leif K-Brooks
<(E-Mail Removed)> wrote:

> Dennis M. Marks wrote:
> > Can there be different colors for words on a pull-down menu either on
> > the same or different lines?

>
> Pull-down menu created with a <select>? Pure CSS? CSS and Javascript?
>


--
Dennis M. Marks


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
 
Reply With Quote
 
Disco Octopus
Guest
Posts: n/a
 
      11-30-2003
Dennis M. Marks wrote:
> <SELECT etc>
> <OPTION etc>
> <OPTION etc>
> </SELECT>
>
> Yes, either or both. Just looking for options to play around with.
> They only have to work in IE, but it would be nice to work in others.
> If you go to my web site http://www.dcs-chico.com/~denmarks/ and go
> to the Amtrak page you will see a list of trains (first pull-down
> menu). I would like the cities to be a different color than the
> trains. Some of the lines are for discontinued trains. I would like
> them to be another color.
>
> In article <xeAxb.174$(E-Mail Removed)>, Leif K-Brooks
> <(E-Mail Removed)> wrote:
>
>> Dennis M. Marks wrote:
>>> Can there be different colors for words on a pull-down menu either
>>> on the same or different lines?

>>
>> Pull-down menu created with a <select>? Pure CSS? CSS and Javascript?


Just took a look at your page. Looks like you got it working!

Dont know if you want to know this, but I will tell you anyway....
It looks like you are creating line in you page using the document.write and
assigning an "id" to the line (<OPTION>) depending on its type..... it may
be 'better' if you assign a class rather than an ID because the way that you
are doing it now means that the ID will not be unique. Or I may be wrong.



 
Reply With Quote
 
Dennis M. Marks
Guest
Posts: n/a
 
      12-01-2003
In article <Ertyb.796$(E-Mail Removed)>, Disco Octopus
<(E-Mail Removed)> wrote:

> Dennis M. Marks wrote:
> > <SELECT etc>
> > <OPTION etc>
> > <OPTION etc>
> > </SELECT>
> >
> > Yes, either or both. Just looking for options to play around with.
> > They only have to work in IE, but it would be nice to work in others.
> > If you go to my web site http://www.dcs-chico.com/~denmarks/ and go
> > to the Amtrak page you will see a list of trains (first pull-down
> > menu). I would like the cities to be a different color than the
> > trains. Some of the lines are for discontinued trains. I would like
> > them to be another color.
> >
> > In article <xeAxb.174$(E-Mail Removed)>, Leif K-Brooks
> > <(E-Mail Removed)> wrote:
> >
> >> Dennis M. Marks wrote:
> >>> Can there be different colors for words on a pull-down menu either
> >>> on the same or different lines?
> >>
> >> Pull-down menu created with a <select>? Pure CSS? CSS and Javascript?

>
> Just took a look at your page. Looks like you got it working!
>
> Dont know if you want to know this, but I will tell you anyway....
> It looks like you are creating line in you page using the document.write and
> assigning an "id" to the line (<OPTION>) depending on its type..... it may
> be 'better' if you assign a class rather than an ID because the way that you
> are doing it now means that the ID will not be unique. Or I may be wrong.
>
>
>


I'm not too clear as to the difference between CLASS and ID. The IDs
are unique for a specific color. Are you saying that multiple OPTIONS
can't have the same ID. It seems to work. BTW: It only works when there
are multiple lines for the SELECT. It will not work for a dropdown
menu.

Can someone clearly explain the difference between CLASS and ID and
when to use them?

--
Dennis M. Marks


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
 
Reply With Quote
 
brucie
Guest
Posts: n/a
 
      12-01-2003
in post <news:301120031609340374%(E-Mail Removed)>
Dennis M. Marks said:

> Can someone clearly explain the difference between CLASS and ID and
> when to use them?


7.5.2 Element identifiers: the id and class attributes
http://www.w3.org/TR/html401/struct/global.html#h-7.5.2


--
brucie
01/December/2003 10:11:38 am kilo
 
Reply With Quote
 
Dennis M. Marks
Guest
Posts: n/a
 
      12-01-2003
In article <bqe14n$214fln$(E-Mail Removed)-berlin.de>, brucie
<(E-Mail Removed)> wrote:

> http://www.w3.org/TR/html401/struct/global.html#h-7.5.2


I said "clearly" please. I know very little about javascript. Can you
tell be if I am using the right one in
http://www.dcs-chico.com/~denmarks/amtrak.html

BTW: I just noticed that the page works in IE but not Navigator. Any
ideas why?

--
Dennis M. Marks


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
 
Reply With Quote
 
brucie
Guest
Posts: n/a
 
      12-01-2003
in post <news:301120031622005274%(E-Mail Removed)>
Dennis M. Marks said:

>> http://www.w3.org/TR/html401/struct/global.html#h-7.5.2


> I said "clearly" please.


you cant get much clearer than that

> I know very little about javascript. Can you
> tell be if I am using the right one in
> http://www.dcs-chico.com/~denmarks/amtrak.html


my DNS says you don't exist and i don't have JS anyway


--
brucie
01/December/2003 10:29:21 am kilo
 
Reply With Quote
 
rf
Guest
Posts: n/a
 
      12-01-2003

"Dennis M. Marks" <(E-Mail Removed)> wrote in message
news:301120031622005274%(E-Mail Removed)...
> In article <bqe14n$214fln$(E-Mail Removed)-berlin.de>, brucie
> <(E-Mail Removed)> wrote:
>
> > http://www.w3.org/TR/html401/struct/global.html#h-7.5.2

>
> I said "clearly" please.


What could be clearer than that? The specs are notorious for being
unreadable but in this case it is quite clear: Both id and class can be use
as a style sheet selector. id must be unique within a document. class may be
shared between several element instances. You are using the same id in
multiple elements. This is not allowed. Use class.

I know very little about javascript.

Nothing to do with javascript. This is CSS.

> Can you
> tell be if I am using the right one in
> http://www.dcs-chico.com/~denmarks/amtrak.html
>
> BTW: I just noticed that the page works in IE but not Navigator. Any
> ideas why?


Probably because of all the markup errors, particularly around the <select>,
<option> and <form> elements.

Take it over to http://validator.w3.org to find them.

Cheers
Richard.


 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing font color from current font color to black color Kamaljeet Saini Ruby 0 02-13-2009 04:58 PM
menu width and background color ? Jusitify menu items on left side?? wildman@noclient.net ASP .Net 0 03-10-2008 08:27 PM
standard way of getting color # string from drawing.color? PJ6 ASP .Net 4 09-15-2005 06:10 PM
how to convert color in style "#e6e6e6" to color object in vb.net moondaddy ASP .Net 3 04-28-2004 04:59 AM
BGR Color to Java Color Andrew Arace Java 7 09-16-2003 05:30 PM



Advertisments