how to hide the css file from...

Discussion in 'CSS' started by tanicos, May 24, 2008.

  1. #1
    Hello

    is there a way to hide the css code for viewers when they go to the path after viewing the source code of the website? or when checking it with w3c validator?
    or restrict access somehow.
    thanks
     
    tanicos, May 24, 2008 IP
  2. mytvtalk

    mytvtalk Active Member

    Messages:
    933
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #2
    make it on a seperate style sheet, then you cannot view it?
     
    mytvtalk, May 24, 2008 IP
  3. steelfrog

    steelfrog Peon

    Messages:
    537
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You'll never be able to hide it completely unless you move into complicated server-side rendering. You can however make it harder for people to simply view it by creating a master stylesheet and using the @import rule, but that will cause problems on older browsers.

    Alternatively, you can look into encrypting your coding with various applications. I've heard HTML Guardian can do CSS, but I've had no experience using it but it might be what you're looking for:
    htmlguardian.org/help_main.html

    Good luck!
     
    steelfrog, May 24, 2008 IP
  4. tanicos

    tanicos Banned

    Messages:
    578
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    thank you steelfrog.'ll try that
     
    tanicos, May 24, 2008 IP
  5. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The short answer is, no you can't. Afterall, the browser needs access to the CSS code in order to render the page, so any tricks you might use to try and hide it simply won't work - and if they do, you'll be staring at raw, unformatted HTML code.
     
    Dan Schulz, May 25, 2008 IP
  6. sjlogan88

    sjlogan88 Peon

    Messages:
    74
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    why would you want to hide your css?
     
    sjlogan88, Jul 9, 2008 IP
  7. risoknop

    risoknop Peon

    Messages:
    914
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You can "hide" it from regular people by using the @import rule. However, more skilled users will still be able to read it. Afterall, user's browser must read the stylesheet in order to display the website correctly.
     
    risoknop, Jul 9, 2008 IP