Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Dec 2004
    Location
    England
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can you use the 'name' attribute in CSS?

    In order to my rollovers working correctly in my navigation bar, I have had to use the 'name' field, where I say where the image is located which acts as a rollover. The only trouble is, when validating the home page containing the rollover navigation bar in XHTML 1.0 Strict, I have found out that the 'name' attribute of the <img> tag no longer exists. Is there anyway of using the 'name' attrribute in CSS at all, or is there some similar way of fixing the problem please?

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    u can replace the name attribute with the id attribute

  • #3
    New Coder
    Join Date
    Dec 2004
    Location
    England
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you for the help, I thought I was on to a winner there, but my rollover still won't work now, even though, i can get the page validated, lol, you just can't win can you?

  • #4
    New Coder
    Join Date
    Dec 2004
    Location
    England
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    by the way, sorry for cross posting, i just thought the javascript guys may know why my rollover won't work if i just delete the 'name' attribute or use the 'id' attribute instead.

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    think u may have to use document.getElementById('youridhere') instead of document.yournamehere not sure on that just a thought
    Last edited by _Aerospace_Eng_; 01-19-2005 at 09:29 PM.

  • #6
    New Coder
    Join Date
    Dec 2004
    Location
    England
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yeah its something like that, thanks for the help though

  • #7
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    Quote Originally Posted by wobblehead
    by the way, sorry for cross posting, i just thought the javascript guys may know why my rollover won't work if i just delete the 'name' attribute or use the 'id' attribute instead.
    You mean, "sorry for triple posting," as you tacked your question onto another thread in the HTML/CSS forum to hijack it and get your problem solved.

    Nothing personal, man, but use some courtesy when asking people for help, cool? Especially when we're doing your homework for you .
    Last edited by rmedek; 01-19-2005 at 11:16 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •