...

View Full Version : exception to css-defined hyperlink properties?



mr johnson
05-09-2006, 07:52 AM
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

_Aerospace_Eng_
05-09-2006, 08:17 AM
Add an id to the footer then use use selectors to target only those links

<div id="footer"><!--your script--></div>

#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/

ronaldb66
05-09-2006, 08:25 AM
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.

_Aerospace_Eng_
05-09-2006, 08:32 AM
Hmm I'm using IE6/WinXP and it applies styles just fine. I do agree though that a contact form would be better

<!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>

mr johnson
05-09-2006, 04:04 PM
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

_Aerospace_Eng_
05-09-2006, 06:37 PM
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/

mr johnson
05-17-2006, 03:55 PM
Thanks for the links.

mr johnson



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum