How to Create hidden CSS? - asp.net

how can I design CSS (specially in asp.net) which user could not save that in client side? I do not want to use from flash or other embedded technology. only frame and css.
thanks.

I don't think that is possible. CSS is telling the browser how an element is supposed to look, making it so a user can't save/understand it would mean the browser wouldn't know how to read it. If you want to obfuscate the css you can check this >> tools for obfuscating html and css

You cannot really prevent the user from downloading the css. The browser needs HTML and CSS to render the page correctly to the user. So the browser actually queries for the HTML and CSS files from server and loads it.
Also you cannot obfuscate CSS files as browsers cant understand those lines.

There is no possibility, only obfuscation.

Impossible. Modern browsers will even show the cascade, rules, etc. that apply to an element in a developer console. Google Chrome for example, has this.

thanks for all answer. that was useful. but why we can not save complete gmail.com or mail.yahoo.com?
I think they use flash or silver or ....

Related

Proprietary Code, Make a pages code inaccessible

Is there any way to hide or otherwise make inaccessible a web pages proprietary CSS code? I know about minification but a minified css file can easily be unpacked.
Thank you for your help,
Marc
Aside from minification and perhaps base64 encoding, there is nothing you can do to mask your CSS text. And those are easily reversible.
There is no way to make it unreadable, as the browser has to be able to read it in order to display it, therefore the user can read it if they want to.
I think you are tackling the wrong problem. Your problem shouldn't be "how do I prevent users from seeing my proprietary css code" it should be "Why does my CSS code have anything proprietary in it."
It really shouldn't, and if it does you should fix that.
No. The browser needs to be able to access the CSS in order to display the page correctly.
You could unpack the elements from the CSS and apply them inline instead. Not sure if that would solve your question though.

Howto inject local css into webpage

I would like to test out CSS on a webpage that I don't have direct access to. Does anyone know how to achieve this ?
So I write my CSS, and on save, that code is used on the webpage.
Of cause this will only happen on my local machine
You could use a simple Bookmarklet, similar to how various jQuery Injectors work.
http://mcdlr.com/css-inject/ might do the trick. For something a bit more dynamic (which takes a URL to a CSS file), check out this jsfiddle I've whipped up! It shouldn't be too hard to modify to pass in inline styles, etc.. so should be a good starting point.
javascript:var%20csshref=prompt('enter%20css%20url');var%20s=document.createElement('link');s.setAttribute('href',csshref);s.setAttribute('type','text/css');s.setAttribute('rel','stylesheet');document.getElementsByTagName('body')[0].appendChild(s);void(s);
Re your comment...
You can just use F12 Dev Tools. Chrome, Firefox and IE are all quite good now. (My preference is Chrome).

How can quickly tell what parts of a CSS file are being used on a page?

I have a massive CSS file that is applied to several pages. I'm hoping to break it down to a common CSS file and several page-level CSS files, since it is becoming difficult to work with. Unfortunately, it's not easy to tell what exactly is common. I was hoping there was a way to quickly see what lines/selectors were being used on a given page. Does anyone know of a tool that can do this? I don't want to use developer tools and go through the DOM elements one by one. I'd like to look at the CSS file and see unused selectors grayed out or something. Thanks!
You can use, at least in Chrome, the Audits tab in the developer tools. Once you run it, it says you which styles aren't used in the current page.
Testing it on this site:
And for Firefox there an add-on called CSS Usage – might be worth a look too.

Modify permanently a CSS of a website that I do not own, and distribute the change to my network

What is the easiest way to do it?
I have difficulties to understand and not having now enough time to spend and study Greasemonkey properly, to just apply a PERMANENT css change to ANY website.
I thought that was more easy, to just add a CSS that would stay with the browser. But I do not find any easy/quick tool customization to just add a simple .css file to do my changes.
For example I would like to restyle Twitter, because I hate the new design, It is killing any kind of graphic personalization that I would like to have.
I need it simple, because I want to let people with not high tech knowledge, to be able to get my personalization, implement it and do it as well.
I know that this could have a security issue, but all that I want to do it is add a piece of CSS, and not additional Javascript functionality.
EDIT: Possibly that could work in all the browsers, not only Chrome and Firefox (I know that might not exist, but I would like to have an alternative for people that use IE)
I am an expert web designer, but I am not a programmer. Outside Javascript I do not script anything else.
Install Stylish. Make custom CSS file. Winning.
You're looking for the Stylish extension.
You can add a user stylesheet in several major browsers that will override the site stylesheet. It will require a good working knowledge of CSS though and for firefox you have to create the file manually in your profile.
http://www.squarefree.com/userstyles/user-style-sheets.html

CSS out of control

Are there any utilities that will crawl a site and determine which css rules are in use and which are not? We have a large site and a huge CSS file (--don't blame me I just got here). And, I think much of it is not being used however I'm afraid to strip stuff out just in case.
The file is confusing and difficult to manage and I think if we can trim it down by getting rid of the unused rules we will have a good starting point to go through and try to make it better.
Try the Dust-Me Selectors Firefox extension by SitePoint. It finds CSS selectors whose rules are never applied to your pages so you can remove them from your stylesheets.
https://addons.mozilla.org/en-US/firefox/addon/10704/?src=collection&collection_id=23d14a2d-b396-c08f-e9ba-b4d34691d5a9
It's an addon in Firebug.
I had the same problem a while ago (5k lines in a CSS) and found this Firefox Plugin which worked very well for me.
The Google Page Speed plugin for Firefox's Firebug addon is also a great tool that will highlight the unused CSS selectors as well as inform you which ones are poor performers.
As always though, you need to be aware that the CSS selector may not be used on "this" page but may very likely be used on another page so be careful when pruning them to ensure they are truly unnecessary.
You can use a service like Unused-CSS
This web app explores the pages of your site and builds clean CSS files

Resources