Hi folks, I want to hide my css file or css online. That no one should view my stylesheet in all the browser. Any ideas...
Can't be done. If the browser can see it, and it has to, so can your visitor. Why would you want to? There's nothing proprietary in css, and no one has ever, anywhere or at anytime had a style sheet so marvelous that the world was clamoring to steal it; and if it were that good, it wouldn't matter anyway. cheers, gary
It's possible that s/he doesn't want the css to be seen because it's the same as another site s/he's got and doens't want casual surfers to link the two sites. In which case, there's still no way to really hide it, but sometimes you could have the normal css link on the one page, and an @import on the other. Doesn't really fool anyone, but is a bit more work to look at it, and most of us are lazy : )
Agreed. I can understand if you've coded some complex web-app that relies heavily on JS and you wouldn't want anyone .. which can be obfuscated.. but it can always be reverse-engineered based on the knowledge of the viewer of the script.
Well, I believe it can be done by properly setting permissions of your css file. But I'm not sure about it. Maybe if you set permission for other people just for executing the file, they won't be able to see it? But then again read permission will be probably required to load the stylesheet.
Let me repeat: It can't be done. The css file is sent to the UA. You can always view the html, css, images and javascript. gary
and even if you could you start to tread into the same area as those bullshit html view source blockers or worse, the nimrods that try to block people from downloading images. In general it's just coding like an jackass in the name of bloat that never once stopped anyone who knows what they are doing.
No need to even waste your time trying. You have had some VERY experienced coders respond stating that you can't. They aren't just guessing, they know. Move on and spend your time doing something productive. It simply can't be done, and if it could, I wouldn't recommend it anyway. It is just plain silly.
Think about it, if you set permissions saying people couldn't see the CSS, that would mean that the browser couldn't see the CSS. If the browser can't see the CSS, it cannot show it. Simple. For the CSS to do its job, it must be made available to the browser. If it's available to the browser, then it's available to the person using the browser. Teh end.
the last time i saw a truly marvellous attempt of javascript and css working in synch was at sitepros.com forum where they try to hide forums posts from the casual unregistered visitor who just stumbled on the site thrugh googles lucky charm... WITHOUT ACTUALLY HIDING IT.... everytimei find something useful out there... i've to go through loads of crap in the source file to actually read the posted entries through the source code... [guess im too lazy to register but not as lazy to scan through the source code...] anyway, as someone mentioned above, there aint no f'ing way you can do that, and there isnt any use.... unless what i think is that you want to hide your new website based on css3.0 standards with cool 3d effects and blah.... else you have built a virtual desktop or a virtual PDA, accessible ffrom the web... and dont want people to see how you arranged the elemental block via css... which anyway would be too complex to mingle with...
yes. you can hide it. dont listen to all these experienced coders... they dont know nothin! use the code below
If your stylesheet is really so briliant that you need to hide it ... I have come across one tricky idea... You can use compress script which will compress the stylesheet to smaller file (no new lines, spaces etc). It won't be hidden but pretty chaotic and extremely hard to read through. Although don't ask me how to do that... I just saw it somewhere so it shoud be possible. And it isn't recommended to hide your source codes... let other people learn from them