-2

Is there anyway to hide css code from source code. So, no anyone can copy my code. Or, any other language is available for styling like css and it is not visible in source code. I know it's silly question.

Here I am also asking about alternate language of css which is not visible in source code.

6
  • How to protect css files is unclear question. And my question is different. Here I am asking about language also for styling like css which is not visible in source code. Commented Oct 28, 2018 at 5:34
  • Yes it's probably a silly question. But why do you want to do this?? Commented Oct 28, 2018 at 5:35
  • I want to hide my source code from user. Commented Oct 28, 2018 at 5:37
  • You say you hide your JavaScript, how do you manage with that? I believe you are the first person in the world who managed so please share. Commented Oct 28, 2018 at 6:18
  • @Andreas most likely OP wraps Javascript in <?php ?> tags. E.g if user is logged in, then display javascript to make ajax request. Of course this file would be .php. Bad practice (Spaghetti code), but i've seen some code snippets following such patterns with the belief of obscurity Commented Oct 28, 2018 at 7:05

2 Answers 2

2

Is there anyway to hide css code from source code. So, no anyone can copy my code.

Short answer: No. CSS must be sent as plain text to your clients' computers if you want your page to be rendered.

I hide my Javascript code from source code by implementing between PHP.

What? No, you cannot hide Javascript either, for the same reason.

You can minify or obfuscate this code, but you cannot avoid sending it (if you want it to be used).

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks @Jonathon Reinhart for clarifying my doubt.
-2

There is NO way to hide the client side components like CSS.

you can check it here

2 Comments

If you find that a question already has an answer on SO, please flag the question as a duplicate (use the flag link under the tags) instead of posting a link to the duplicate as an answer. Because this question is a duplicate it will eventually get deleted and you will lose any reputation gain from the answer anyway.
got that! @Nick

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.