I want to protect my e-mail address on webpages.
But I don't know JavaScript and PHP. I know only HTML and CSS.
So, please help me how to protect my email address with CSS only.
I want to protect my e-mail address on webpages.
But I don't know JavaScript and PHP. I know only HTML and CSS.
So, please help me how to protect my email address with CSS only.
Flexbox allows you to change the order of items inside a containing element, we can use this to separate and reorder parts of our email address in the html but present them to the user as a legible whole.
Here we use
flex-direction: row-reverse
to reverse the order of the elements.A scammer could probably work this out if he tried hard, all he has to do is reverse the elements to recreate the address. For a more thorough attempt we can specify the order manually.
Here we use
order
to specify our own order so a simple reverse cannot be used.Unfortunately doing any of this breaks copy/paste so your user will have to type out the address, but it is better than receiving correspondence from another Nigerian prince. Use this in conjunction with other techniques for a truly bulletproof email address.
I used for some time a similar JavaScript technique that allowed the "mailto" functionality while keeping the HTML valid :
HTML :
JavaScript (small jQuery plugin)
Usage
http://codepen.io/ced-anamorphik/pen/QwVrKZ
But lately Google Chrome displayed a phishing warning on the website. As this is not entirely wrong (technically the link is spoofed indeed), is there another simple solution to this ?
You can use Font Awesome:
In
<head>
:In
<body>
:Use the reCAPTCHA Mailhide API
Mail hide using api
Encode site url to convert data email
Demo
Try this code:
This is just the email encoded in hexadecimal.