Results 1 to 10 of 10

Thread: CSS for special hover link

  1. #1
    Join Date
    Oct 2004

    CSS for special hover link


    My last post dates from 2004!

    I can't figure out why I can't get the graphic links on my new test page,

    which is here: http://www.nondairycreamer.com/x_testing/index.html

    to have the same effect for the hovering status as they do on my old home page, which you can see here:

    http://www.nondairycreamer.com/index.html .

    The text links on the new page have the desired effect, but not the graphic links.

    When a user hovers over a link, one should see an animated dotted line underneath.

    For some reason, on my new page, you actually can see the hover effect take place on the middle graphic, and I know that that logo is a GIF with some transparency!

    I am using a completely different CSS file for the new file, and I just can't pin down the culprit that might be affecting the behavior.

    The old CSS information is on the old index.html page itself:

    And the new CSS file is an external stylesheet located here:

    Any clues?

    Is there a CSS line in the stylesheet somewhere that is the culprit?

    Could it have anything to do with the document types of these two pages being different?

    And most importantly, mow might I find the way to create that effect for all my graphic links on my new page?

    I know the old page has some sloppy and inconsistent code (please bear with me), but the issue for me concerns the functioning of the new page.

    Last edited by pooh; 02-03-2013 at 09:52 PM.

  2. #2
    Join Date
    Mar 2009
    Wherever i lay my hat
    It's because the very bottom of the <a> tag doesn't fit in #myinnercontainer or table. Try to add all links background-color: yellow and you will see, that no part of the text-link is visible. Your approach relies on the fact, that the bottom part of the <a> tag would still be visible and so you can use the very last pixel of it for the background effect. That doesn't have to be true all the time depending on the font-size, line-height, image dimensions, etc...

    Add a rule:
    a { background-color: yellow;}
    a img { padding-bottom: 5px;}

    Try using some background-color or border around elements for the development stage - it will help you spot the errors.

    And for everyones sakes, don't use tables for markup in 2013. Use absolute positioning, floats or some grid system

  3. #3
    Join Date
    Oct 2004
    Thanks for the reply.
    I will take some time to explore your suggestions and testing.

    And also thanks for the push to use another system other than tables. I needed the push.
    I will explore some grid system.

    I'll let you know if I run into more snags after this step.

  4. #4
    Join Date
    Feb 2013
    New York, USA
    I think its working....I just need to see that Does it possible to change the other element after hovering over the link or image? I think it will be related to the Jquery. Isn't it?

  5. #5
    Join Date
    Mar 2009
    Wherever i lay my hat
    @pooh: You're welcome. I just had a quick look at your page and i thought it has to be something easy. Then i spent about half an hour inspecting your code before i tried the backgrounds and realised, what's going on. Well, i'm learning this way, too

    @Melvinscott92: I'm sorry, i didn't really understand your question. It is possible to modify other elements on page after hovering over another, but via css only if it is a child of the hovered element. In other situations you have to use javascript, regardless of framework.

  6. #6
    Join Date
    Feb 2013
    New York, USA
    @haulin: Thanks for reply I got that solution from another forum. It something we could do by using the java script and jquery too.

  7. #7
    Join Date
    Oct 2004
    Greetings again. I'm not sure if folks understand the gist of my question, so I'm trying a different approach.
    Or perhaps it is I who is not understanding your answers.

    I have created two simple files for people to see the effect that I am referring to.

    Here is the older file: http://www.nondairycreamer.com/x_tes...ing_older.html
    Here is the newer file: http://www.nondairycreamer.com/x_tes...ing_newer.html

    In my "older" document, you will see an animated gif appear underneath the links when the mouse hovers over them – both for text links as well as for graphic links.

    In my newer document, the hover effect works for the text links, but not for graphic links. Actually, I found that it does work for a GIF file that has transparency. And perhaps this means something.
    Here is a link for that page: http://www.nondairycreamer.com/x_testing/index.html [Notice that I finally arrived in 2013 and eliminated the tables in favor of using CSS grid]

    The only difference between the two files are the initial lines of document identification info at the top of the page.

    The older file has this info:

    <!DOCTYPE html
    PUBLIC "-//W3C//DTD HTML 4.01//EN"
    <html lang="en-US">

    <head profile="http://www.w3.org/2005/11/profile">

    The newer file has this info:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

    My Questions:

    1. Can someone explain why this would affect the link behavior?
    2. Can someone show me how I might be able to get the behavior to work in my newer file (without changing the document identification lines in the beginning ?!)

    Many thanks for considering this again.
    Last edited by pooh; 02-08-2013 at 01:15 AM.

  8. #8
    Join Date
    Oct 2004
    I was able to work around the issue and get the effect with the other images by simply editing the images in Photoshop, adding some white pixels to the bottom of the image, saving the graphics as GIF files and specifying that white color as transparent.

    However, I'm still curious if anyone can offer any info about why the doc type would effect this behavior ?


  9. #9
    Join Date
    Feb 2007
    New York, NY
    XHTML requires adherence to XML specif9ications -- such as self-closing <br /> of "empty tags.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Untitled Document</title>
    Wonder if that might affect the differences ??

  10. #10
    Join Date
    Oct 2004
    Thanks for your input.

    On another forum, someone came up an explanation and some CSS specs that did the trick.
    See the link here:


    I have since changed the links for the example page, but you can see what I was talking about here:

    HTML File: http://www.nondairycreamer.com/x_tes...ing_older.html

    XHTML File: http://www.nondairycreamer.com/x_tes...ing_newer.html


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.17655 seconds
  • Memory Usage 2,950KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (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
  • (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 (72):
  • 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_postinfo_query
  • fetch_postinfo
  • 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