Results 1 to 10 of 10

Thread: :link,:visited question

  1. #1
    Join Date
    Dec 2002
    Boston, MA

    :link,:visited question

    I'm experiencing something strange...
    Here is what I have going on:
    -page1.html that links to page2.html (target is same window, no frames)
    -for page1.html I have defined a:link, a:visited, a:hover, and a:active (in that order)
    -the links on page1.html are grouped in a <table>
    -I click on a link and page2.html comes up...when I link back to page1.html, all the links within the table are colored as a:visited.
    -Ideally, when I return to page1.html, I'd like to see the unvisited links remain as the a:link color.

    Anyone have an idea what is happening? Fixes?

  2. #2
    Join Date
    Nov 2002
    For starters, which browsers did you test with? This sounds like a possible browserbug.

    You have an URL to the page?
    // Stefan Huszics

  3. #3
    Join Date
    Nov 2002
    put: <body vlink="color">

  4. #4
    Join Date
    Nov 2002
    Originally posted by Dave Clark
    [B]I heard once that order was important (I'd call that a bug, really).
    It's not a "bug", it's an very central and important part of the CSS language. Infact it's so important that the C in CSS actually stands for this feature, called Cascading.
    The Cascading concept means that a later rule always overrides a previous rule (of the same specificy/importance).
    Without this feature CSS would only be a fraction as powerfull as a language as it is with this feature.

    I take advantage of the cascading heavily on basicly every webpage I make, especially to work around browserbugs in an effective manner.

    I have a page that uses them in this order:
    a:link       { text-decoration: none; }
    a:hover      { text-decoration: underline; }
    a:active     { text-decoration: line-through; }
    a:visited    { text-decoration: none; }
    That is the wrong order for how most people would want it to work.
    If you have it like that, once a link has been visited it will NEVER get the underline or line-though rules applied (in a nonbuggy browser).
    This is becuse the last rule that applies to the link is a:visited { text-decoration: none; }

    Most times you probably want this order (that amui stated at the top)

    // Stefan Huszics

  5. #5
    Join Date
    Dec 2002
    Boston, MA


    I don't have it public just yet...heheh, for obvious reason that I have a problem. :-)

    Yeah, I messed with the ordering of the a: styles, but like the docs and stefan said, the latter does supercede the formers.

    I'm testing the page with IE6.0, which is why I'm confused why I'm getting this type of behavior. Checked out cnn.com and yahoo.com and they seem to have the right idea...

    I'm probably going to fiddle with a simple test page to see if I can repeat the phenomenon. Stay tuned, and if anyone has any input, much appreciated!!!

  6. #6
    Join Date
    Dec 2002
    Boston, MA

    problem found

    Silly mistake on my part. So the CSS does not seem to distinguish <a href="page2.html#article1"> from <a href="page2.html#article2">. Since both links point to page2.html, all the links are considered visited.

    Anyone know a way to increase granularity to the anchor?


  7. #7
    Join Date
    Nov 2002

    Re: problem found

    Originally posted by amui
    Since both links point to page2.html, all the links are considered visited.

    Anyone know a way to increase granularity to the anchor?
    Sadly the implementation of the visisted state is up to each browser AFAIK, and the defacto standard is that if you visited the page, all links to the same page show up as visited.
    // Stefan Huszics

  8. #8
    Join Date
    Nov 2002
    Originally posted by Dave Clark
    I changed the order, as recommended, and it does work even better now. Thanks.
    There is other states and combinations one can use too with links that are quite nice, however IE is buggy with anything but the simplest of codes. On one site I use eg this (all rules with html>body is stuff IE doesn't implement correctly)

    .nav a:link,
    .nav a:visited { color:#53533C; background:#dda; }
    .nav a:hover { color:#000; background:#ffc; }
    html>body .nav a:focus { color:#FFF; background:#636347; }
    html>body .nav a:hover:focus { color:#222; background:#85b7fe; }
    .nav a:active { color:#FFF; background:#636347; }
    html>body .nav a:hover:active { color:#222; background:#9cf; }
    // Stefan Huszics

  9. #9
    Join Date
    Nov 2002
    Baltimore, Maryland
    Neither, read the specification: http://www.w3.org/TR/REC-CSS1#color-units.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  10. #10
    Join Date
    Dec 2002
    Perth, Western Australia


    I only know two correct ways to write hex colours:
    • #XXXXXX
      Ie. six hex chars. This is the normal representation for 24bit colour.
    • #XXX
      Three hex chars. This is a shorthand and the "safe" way to define a colour.

    The three hex chars format is expanded in the following fashion:
    #ABC becomes #AABBCC
    #FFF becomes #FFFFFF
    #000 becomes #000000
    #13D becomes #1133DD

    Why? well, as you might notice, now you have only 16^3 colours to work with, instead of 16^6

    To the human's eye colours, such as #AAA and #AAB will look only slightly different, while we probably would not notice a colour change at all when we are writing #AAAAAA and #AAAAAB. So the second notation takes more time for the brain to figure out. The main reason: to ensure that older monitors produce the same colour as you intended.

    Note: this is for CSS only, the same doesn't work for HTML
    Last edited by King Pellinore; 12-12-2002 at 10:45 PM.
    Not all browsers are good. Some of them go bad.
    Not long ago, one of them went as bad as you can go. His hame was I.. I... Well, people usually say that he is a browser That Must Not Be Named.
    That browser killed many of our best coding conventions. It twists features. It knows how to counter-bug any of our designs. It is in possesion of a group of supporters so large that no other browser may stand up to it and live.
    But now there is a hope.

    Site: http://nik-sergeev.com (wood sculpture).

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.10380 seconds
  • Memory Usage 2,937KB
  • Queries Executed 13 (?)
More Information
Template Usage (34):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (10)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates