1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to hide css online?

Discussion in 'CSS' started by webblab, Feb 15, 2008.

  1. #1
    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...
     
    webblab, Feb 15, 2008 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    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
     
    kk5st, Feb 15, 2008 IP
  3. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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 : )
     
    Stomme poes, Feb 16, 2008 IP
  4. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #4
    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.
     
    soulscratch, Feb 16, 2008 IP
  5. risoknop

    risoknop Peon

    Messages:
    914
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #5
    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.:confused:
     
    risoknop, Feb 16, 2008 IP
  6. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #6
    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
     
    kk5st, Feb 16, 2008 IP
  7. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #7
    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.
     
    deathshadow, Feb 16, 2008 IP
  8. webblab

    webblab Guest

    Messages:
    394
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Permissions didn't help!:mad:
     
    webblab, Feb 19, 2008 IP
  9. scubita

    scubita Peon

    Messages:
    5,550
    Likes Received:
    318
    Best Answers:
    0
    Trophy Points:
    0
    #9
    :p and what do you expect? a coconuts and a marguerita?
     
    scubita, Feb 19, 2008 IP
  10. ChaosFoo

    ChaosFoo Peon

    Messages:
    232
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #10
    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.
     
    ChaosFoo, Feb 19, 2008 IP
  11. wildarmz

    wildarmz Peon

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Listen to him ;)
     
    wildarmz, Feb 20, 2008 IP
  12. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #12
    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.
     
    Stomme poes, Feb 20, 2008 IP
  13. Cobnut

    Cobnut Peon

    Messages:
    184
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Just out of interest, why do you want to hide the CSS?

    Jon
     
    Cobnut, Feb 20, 2008 IP
  14. designexpert

    designexpert Guest

    Messages:
    196
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #14
    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... :p
     
    designexpert, Feb 22, 2008 IP
  15. Romanos

    Romanos Well-Known Member

    Messages:
    1,062
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    165
    #15
    You could hide the source instead.
     
    Romanos, Feb 25, 2008 IP
  16. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #16
    yes. you can hide it. dont listen to all these experienced coders... they dont know nothin! use the code below

     
    soulscratch, Feb 25, 2008 IP
  17. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #17
    ... and people call me a smarmy bastard.
     
    deathshadow, Feb 25, 2008 IP
  18. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #18
    Lawlz.

    The above code was a joke : )
     
    Stomme poes, Mar 1, 2008 IP
  19. risoknop

    risoknop Peon

    Messages:
    914
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #19
    If your stylesheet is really so briliant that you need to hide it :D ... 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 :)
     
    risoknop, Mar 1, 2008 IP
  20. arcadesstuff

    arcadesstuff Banned

    Messages:
    296
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #20
    I think you need external style sheet: read this.

    It might help.
     
    arcadesstuff, Mar 1, 2008 IP