Style in Option Statement

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dennis M. Marks

    #1

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

    #2
    Re: Style in Option Statement

    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



    "Dennis M. Marks" <denmarks@dcsi. net> ha scritto nel messaggio
    news:2911200310 38448099%denmar ks@dcsi.net...[color=blue]
    > 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! =-----[/color]


    Comment

    • Dennis M. Marks

      #3
      Re: Style in Option Statement - MORE INFO

      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 <29112003103844 8099%denmarks@d csi.net>, Dennis M. Marks
      <denmarks@dcsi. net> wrote:
      [color=blue]
      > 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.[/color]

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

      Comment

      • Michael Winter

        #4
        Re: Style in Option Statement - MORE INFO

        Dennis M. Marks wrote on 29 Nov 2003:
        [color=blue]
        > 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?[/color]

        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).
        [color=blue]
        > See page http://www.dcs-chico.com/~denmarks/amtrak.html[/color]

        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.Winter@blueyo nder.co.uk.invalid (remove ".invalid" to reply)

        Comment

        • Dennis M. Marks

          #5
          Re: Style in Option Statement -SOLVED (sort of)

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

          Comment

          • Michael Winter

            #6
            Re: Style in Option Statement -SOLVED (sort of)

            Dennis M. Marks wrote on 29 Nov 2003:
            [color=blue]
            > 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.[/color]

            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.Winter@blueyo nder.co.uk.invalid (remove ".invalid" to reply)

            Comment

            Working...