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
    Jan 2004
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    exception to css-defined hyperlink properties?

    Hi All,

    At http://69.36.187.233/index.shtml I'm using a css to define hyperlink properties throughout the site. Works fine but in the footer - which has a bg the same as the font color of the links in the rest of the page - the link, an email address - is there and functional but invisible since it's the same color as the bg of the cell that contains it.

    The css overrides both a <font color=> and a <td style=> tag. I've tried both.

    Any suggestion or could someone point me to an example to create an exception for this? The footer is an .inc statement (last <div> on the page) and appears on every page. The email address is only displayed on the screen by a .js to prevent harvesting of the address from the html.

    The js is
    var somebody = "info";
    var somewhere = "ugwa.org";

    function hemi()
    {
    document.write("<a href=\"mailto");
    document.write(":" + somebody + "@");
    document.write(somewhere + "\">" + somebody + "@" + somewhere + "<\/a>");
    }
    and is invoked by
    <script language="JavaScript" type="text/javascript">hemi()</script>
    at the bottom of the page

    Thanks

    mr johnson

  • #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
    Add an id to the footer then use use selectors to target only those links
    Code:
    <div id="footer"><!--your script--></div>
    Code:
    #footer a {
    /*CSS stuff*/
    }
    I might add you really shouldn't be using tables for your layout at all. I suggest you read this as well. http://www.hotdesign.com/seybold/
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dynamic content

    Looks like the browser (I used IE6.0/Win2000, for lack of anything better) doesn't apply any style to JS generated content; you might have to resort to JS as well to dynamically set the color property for this bit.

    However, I wouldn't resort to JS trickery like this at all; rather use a contact form of sorts. I don't know if your host supports a server side scripting language, but simple form handlers are available in just about any language, and if that's no option, there are services that provide form handling scripts.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #4
    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
    Hmm I'm using IE6/WinXP and it applies styles just fine. I do agree though that a contact form would be better
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <style type="text/css">
    #test a {
    color:#008000;
    text-decoration:none;
    }
    </style>
    <script type="text/javascript">
    var somebody = "info";
    var somewhere = "ugwa.org";
    
    function hemi()
    {
    document.write("<a href=\"mailto");
    document.write(":" + somebody + "@");
    document.write(somewhere + "\">" + somebody + "@" + somewhere + "<\/a>");
    }
    </script>
    </head>
    
    <body>
    <span id="test"><script type="text/javascript">hemi();</script></span>
    </body>
    </html>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New Coder
    Join Date
    Jan 2004
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    exception to css-defined hyperlink properties?

    Hi _Aerospace_Eng_,

    Thanks for your concise and helpful reply. A few tweaks and http://69.36.187.233/index.shtml is working as intended.

    Thanks also to Ronaldb66 for your reply.

    _Aerospace_Eng_,
    re: your suggestion in the prior reply aboutt css and the link to http://www.hotdesign.com/seybold/, I have visited that page and others to try to get the hang of non-table design. After wading through several conflicting (or at least confusing) sites, my enthusiam was dimmed a bit, not so much by the learning curve of css itself, but by the "Danger, Will Robinson!"s about conflicts with various browsers.

    I am still interested in pursuing this though and I'd appreciate your suggestions for other sites that give the best overview / tutorial / examples, particularly for the nuts and bolts tags and syntax of css. Some of the sites I've visited give a few examples using "baby steps" and then you're suddenly thrust into the race.

    Thanks again,

    mr johnson

  • #6
    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
    www.bonrouge.com is a good one. www.htmldog.com is good. www.w3schools.com/css/ is good. This one will be helpful when it comes to floating. http://css.maxdesign.com.au/floatutorial/
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #7
    New Coder
    Join Date
    Jan 2004
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    exception to css-defined hyperlink properties?

    Thanks for the links.

    mr johnson


  •  

    Posting Permissions

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