Thursday, August 25, 2011

Unselectable Text In Your Blog Posts

A lot of people want some of the text in their blog to be unselectable. This can be achieved, but as always with anything on the net, nothing will stop a willing person from finding a way around, or just retyping what you wrote. But that's no reason not to make it difficult for them!! For example, try selecting the orange text above. Not so easy is it. Here's how I did it...

Plagiarism


First, in your post write out everything you wish as per normal. No change here. Next click on "Edit HTML".

Here you have to decide if you want to make the whole post unselectable, or just a paragraph. It's up to you. I opted for just the first paragraph in this post. To make it unselectable I simply surrounded the desired text with a "div" tag and added some simple code (shown in orange below).

Important note: Once you have added this you will NOT be able to edit your text in the "Compose" tab, only in the "Edit HTML" tab.

Here is what I used:


<div ondragstart="return false;" onselectstart="return false;" style="-moz-user-select: none; -webkit-user-select: none;">
A lot of people want some of the text in their blog to be unselectable. This can be achieved, but as always with anything on the net,<b> <span class="Apple-style-span" style="color: #ff9900;">nothing will stop a willing person from finding a way around</span></b>, or just retyping what you wrote. But that's no reason not to make it difficult for them!! For example, try selecting the orange text above. Not so easy is it. Here's how I did it...</div>


In the example above I showed the "div" tags surrounding just the paragraph, but I actually surrounded them around the picture below as well as a test. This means you could use the tags surrounding the entire post to make all the text unselectable. The pictures can still be saved with a right-click. A post for later...

This may not be the perfect code, but while I keep searching for a better method for Blogger, it'll do.

5 comments: