Tngld
Tngld

Reputation: 153

Styling encoded mailto address

I have used an online email encoder to generate a sort-of harvester-proof email-link, but this link won't adapt to my styling. Does anybody know how I can style this kind of link? As of now I don't know where to call the css class.

Here is an example of the link I've encoded:

<div class="mailto-link"><script type="text/javascript"><!--
var gefmyis = ['m','r','l','l','i','a','m','m',' ','e','o','a','"','h','m','e','<','e','/','o',':','a',
'>','a','s','t','c','m','s','l','"','=','.','i','t','>',
'l','f','i','@','.','s','s','"','<','e','"','o','a','c',
't','l','m','t','@',' ','c','=','e','e','i','t','a','a'];
var lmmezyh = 
[29,4,25,55,54,53,9,22,31,5,14,23,38,3,40,51,0,17,61,28,15,
34,45,62,36,13,27,52,18,43,8,37,26,24,49,63,33,6,11,20,56,35,
48,30,60,39,44,58,1,32,46,12,59,16,50,2,57,7,47,21,42,19,10,41];
var bsmqvte= new Array();for(var i=0;i<lmmezyh.length;i++)
{bsmqvte[lmmezyh[i]] = gefmyis[i]; }for(var i=0;i<bsmqvte.length;i++)
{document.write(bsmqvte[i]);}
// --></script>
<noscript>Please enable Javascript to see the email address</noscript></div>

Thanks!

Upvotes: 1

Views: 326

Answers (1)

Roko C. Buljan
Roko C. Buljan

Reputation: 206007

Edit:

By just inspecting in Console what is actually created by that script you'll notice this:

<a class="email" href="mailto:[email protected]">[email protected]</a>

means a.email in your CSS will suffice:

a.email{
    font-weight: bold;
    color:red;
}

http://jsfiddle.net/990exhow/


Simply use:

a[href^="mailto:"]{
    font-weight: bold;
    color:red;
}

http://jsfiddle.net/pbve1aum/1/

https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors

Or wrap all into a SPAN

<span class="mailtoStyle">
    <!-- all in here -->
</span>

and in your CSS:

.mailtoStyle a{
    font-weight: bold;
    color:red;
}

http://jsfiddle.net/pbve1aum/2/

Upvotes: 5

Related Questions