Dynamically Changing Styles

Discussion in 'HTML' started by Dennis M. Marks, Dec 5, 2003.

  1. Please tell me where to look or answer the following. Can a div or span
    style be changed from within the html outside of the div or span? Can
    it be done without javascript? What I would like to do is alter the
    color of menu items depending on the availability of javascript.

    For Example:

    <STYLE>
    #xxx {color: black}
    </STYLE>
    ------
    <SPAN ID="xxx"">
    <a href="xxxxx">MENU ITEM</a>
    </SPAN>
    ------
    <NOSCRIPT>
    --change style in ID="xxx" to color: red
    </NOSCRIPT>

    --
    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! =-----
    Dennis M. Marks, Dec 5, 2003
    #1
    1. Advertising

  2. Dennis M. Marks

    Eric Bohlman Guest

    "Dennis M. Marks" <> wrote in
    news:051220030711091432%:

    > Please tell me where to look or answer the following. Can a div or span
    > style be changed from within the html outside of the div or span? Can


    No.

    > it be done without javascript? What I would like to do is alter the
    > color of menu items depending on the availability of javascript.


    You can still accomplish that task easily: just set the colors to what you
    want them to be if JS is unavailable, and then use an onLoad event to run a
    script that changes them.
    Eric Bohlman, Dec 5, 2003
    #2
    1. Advertising

  3. In article <Xns944864038E717ebohlmanomsdevcom@130.133.1.4>, Eric
    Bohlman <> wrote:

    > "Dennis M. Marks" <> wrote in
    > news:051220030711091432%:
    >
    > > Please tell me where to look or answer the following. Can a div or span
    > > style be changed from within the html outside of the div or span? Can

    >
    > No.
    >
    > > it be done without javascript? What I would like to do is alter the
    > > color of menu items depending on the availability of javascript.

    >
    > You can still accomplish that task easily: just set the colors to what you
    > want them to be if JS is unavailable, and then use an onLoad event to run a
    > script that changes them.
    >


    I managed to do it as follows. By default I have the color of specific
    lines red. Then a script changes them to black. If there is no
    javascript the color remains red and I display a warning message.
    See http://www.dcs-chico.com/~denmarks/index.html

    Did I use the combination of class and id correctly? The ids are unique
    but the class is not.

    --
    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! =-----
    Dennis M. Marks, Dec 5, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VGVycnk=?=

    Changing styles sheets on a per user basis

    =?Utf-8?B?VGVycnk=?=, Feb 4, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    368
    =?Utf-8?B?VGVycnk=?=
    Feb 4, 2004
  2. Eric Pinnell
    Replies:
    5
    Views:
    960
  3. tshad
    Replies:
    2
    Views:
    357
    tshad
    Aug 23, 2007
  4. et

    changing styles of gridview

    et, Jan 26, 2007, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    720
  5. Brett

    Changing Hyperlink Styles for Each Row in a Table

    Brett, Jan 17, 2008, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    164
    PJ on Development
    Jan 25, 2008
Loading...

Share This Page