473,325 Members | 2,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Style in Option Statement

Please look at page http://www.dcs-chico.com/~denmarks/amtrak.html

I am trying to change the color of the first dropdown menu but
everything that I have tried has no effect.

If I put the style in the select statement the color only applies to
the undroppeddown menu. When opened the color disappears. In the option
statement it has no effect.

I have tried IE and Netscape on a Mac.

--
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! =-----
Jul 20 '05 #1
5 3864
AV
you should put your style declaration applying it to the OPTION tag: the
select affects all the options, but if you include a styule statement (even
via script) to a single option or to more options, that would positively
override for the affected option the select style statements (on my website
the what's new multiple select menu in the second page alternates the option
colors in that way for instance).
I don't know what happens with a mac though.
I hope this helps a little bit at least
ciao
Alberto
http://www.unitedscripters.com/
"Dennis M. Marks" <de******@dcsi.net> ha scritto nel messaggio
news:291120031038448099%de******@dcsi.net...
Please look at page http://www.dcs-chico.com/~denmarks/amtrak.html

I am trying to change the color of the first dropdown menu but
everything that I have tried has no effect.

If I put the style in the select statement the color only applies to
the undroppeddown menu. When opened the color disappears. In the option
statement it has no effect.

I have tried IE and Netscape on a Mac.

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

Jul 20 '05 #2
I have added the following to my HTML

<style type="text/css">
SELECT {color:red; background-color:blue}
OPTION {color:red; background-color:blue}
</style>

The SELECT works, the OPTION does not. Why?

See page http://www.dcs-chico.com/~denmarks/amtrak.html

In article <29*************************@dcsi.net>, Dennis M. Marks
<de******@dcsi.net> wrote:
Please look at page http://www.dcs-chico.com/~denmarks/amtrak.html

I am trying to change the color of the first dropdown menu but
everything that I have tried has no effect.

If I put the style in the select statement the color only applies to
the undroppeddown menu. When opened the color disappears. In the option
statement it has no effect.

I have tried IE and Netscape on a Mac.


--
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! =-----
Jul 20 '05 #3
Dennis M. Marks wrote on 29 Nov 2003:
I have added the following to my HTML

<style type="text/css">
SELECT {color:red; background-color:blue}
OPTION {color:red; background-color:blue}
</style>

The SELECT works, the OPTION does not. Why?
At present, they are identical styles, so you couldn't see any
changes in any case. However, applying a colour style to OPTION in
IE6/Win does work (as I said in my reply to your original post).
See page http://www.dcs-chico.com/~denmarks/amtrak.html


As I said in my reply to your original post, not all browsers will
support this. Even if they did, users can disable your style sheet
(and with those colours, I would). You shouldn't rely on presentation
alone to communicate meaning, that should be done with structure.

Mike

And please don't top-post.

--
Michael Winter
M.******@blueyonder.co.uk.invalid (remove ".invalid" to reply)
Jul 20 '05 #4
As I said the styles did not work for the OPTION statement when used
inline (styles=) or in <STYLES></STYLES>. When I set the styles for
both the SELECT and OPTION the same as you last saw it, it only colored
the first line.

I solved the problem by changing the SIZE parameter on the SELECT
statement which makes the page look better anyway. Now the styles work.
I am now using 3 different colors. It looks like it does not work when
the SIZE=1, at least on a Mac.

BTW: I tried using IE and Navigator on a Mac.

--
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! =-----
Jul 20 '05 #5
Dennis M. Marks wrote on 29 Nov 2003:
As I said the styles did not work for the OPTION statement when
used inline (styles=) or in <STYLES></STYLES>. When I set the
styles for both the SELECT and OPTION the same as you last saw
it, it only colored the first line.

I solved the problem by changing the SIZE parameter on the
SELECT statement which makes the page look better anyway. Now
the styles work. I am now using 3 different colors. It looks
like it does not work when the SIZE=1, at least on a Mac.

BTW: I tried using IE and Navigator on a Mac.


There's a syntax error in your (inline) script. In the for loop, you
have this code:

if (Trains[i][3][0]=="NA") {document.write("<OPTION id=blue>");};
else {if (Trains[i][3][0]=="DD") {
document.write("<OPTION id=red>");};
else {document.write("<OPTION id=green>");};};

The terminating semi-colons should not be there. You should re-write
it like this:

if (Trains[i][3][0]=="NA") {
document.write("<OPTION id=blue>");
} else if (Trains[i][3][0]=="DD") {
document.write("<OPTION id=red>");
} else {
document.write("<OPTION id=green>");
}

I also feel that elseif equivalent statements are more readable if
presented as I wrote above. Of course, that's purely a subjective
comment. If you don't like it, the above could be presented:

if (Trains[i][3][0]=="NA") {
document.write("<OPTION id=blue>");
} else {
if (Trains[i][3][0]=="DD") {
document.write("<OPTION id=red>");
} else {
document.write("<OPTION id=green>");
}
}

Mike

--
Michael Winter
M.******@blueyonder.co.uk.invalid (remove ".invalid" to reply)
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jeff Anderson | last post by:
Is there a style for a select option's "selected" color? For example: <HTML> <BODY> <FORM NAME="form1"> <SELECT NAME="mySelect" SIZE="7" style="background-color:red;"> <OPTION>Test 1...
9
by: Rolf Brauser | last post by:
Hi, is it possible to style the elements from an dropdownmenue <select> <option></option> </select> tag ? Thanks for any help. Rolf
9
by: netclectic | last post by:
I'm dynamically adding options to a select list in javascript and i need to be able to set the height of the option, but setting style.height has not effect, I also tried style.pixelHeight but no...
5
by: Ben | last post by:
I have a form for data entry which is in a table. I have a select box to enter a customer name, which takes it's options from the customer database. I have a button to add a new customer. What I...
6
by: mswlogo | last post by:
There are many threads on the lack of a true unmanaged C++ const like behavior in C# (.Net) and that's not what this topic is about. The topic is, what is the best practical way to live with it. ...
5
by: Isha | last post by:
Hi all, I wanted to change the background color for only the first option in a select box, but following changed the background color for the whole dropdown box. <select name="alltags"...
4
by: Winston | last post by:
Where is the mistake? I want to make a simple menu. These are two pieces of two files... function ShowMenu(objeto) { is_open = document.getElementById(objeto).style.display;...
3
by: Jason Carlton | last post by:
Is there a way to change the font-family and font-size for each individual option in a select menu? Something along the lines of: <select size="1"> <option style="font-family: Arial; font-size:...
55
by: aarklon | last post by:
Hi all, I was going through the book "C Elements of style" by steve oualline. in this book many guidelines are given. the following were seen in the book as rules 1) while(1) is preferred...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.