-2

I've been target for someone used to copy my website style sheet so this time i would like to protect my css file using the following :-

i will create fake.css and inside it will put the following code based on @import url

@import url("css/real.css");

Now if he view source will only see the above line and will try to call

www.my_site.com/css/real.css

but i will indeed using my hosting panel will not allow direct access to files .css

Now my question, Is it save enough or still he can get the code by using firebug or whatever !? ~ thanks

Reham Fahmy
  • 4,937
  • 15
  • 50
  • 71
  • 3
    They will be able to get it using firebug or inspecting the element. If you don't want your CSS to be seen, don't put it on the internet. – JSW189 Feb 19 '13 at 20:17
  • 1
    or create old-school website without CSS ;-) – jjj Feb 19 '13 at 20:20
  • all right thank you all, it was just thoughts into my mind :) cause i've had enough of someone copy/paste my website – Reham Fahmy Feb 19 '13 at 20:21
  • There's nothing you can do to completely stop someone from copying your styles. The best I can think of is something like obfuscating your HTML/CSS/JS, but that would at best slow them down if they are trying to cherry pick stuff. It might be hindering enough to make them target some other site? Related to obfuscation: http://stackoverflow.com/questions/7278863/tools-for-obfuscating-html-and-css – ajp15243 Feb 19 '13 at 20:23
  • @jeromeM The style attribute is so tempting, eh? ;) – FelipeAls Feb 19 '13 at 20:41
  • You could put half of your rules in imported CSS and the other half in the "parent" CSS file to make their copy failure less obvious but that would cause an extra hit for every user and would only prevent noobs from stealing your code. If their server is in the US, you could send a DMCA takedown notice (IANAL and that must be a boring activity ;) ) – FelipeAls Feb 19 '13 at 20:47

1 Answers1

3

There is no way to hide CSS from your users.

bookcasey
  • 39,223
  • 13
  • 77
  • 94