hidden style sheet

D

dorayme

baldo said:
Is it possible to hide a style sheet for all browsers?

You cannot actually hide other people's stylesheets whether they be
the default one the browser uses or one made and used by the browser
user (called a user stylesheet) but you can supply your own so as to
take your best shot to override what you expect would happen without
your intervention.

For example, to take just one case, the BODY element almost invariably
gets a margin, but you can, and it is actually quite common for
authors to, set it to 0.

(I believe Broweroginsts once tried to sneak html {display: none;}
into other people's websites but they failed. They contented
themselves with adding this to their own websites so that no one would
normally see anything at all. Unfortunately browser makers gave users
simple menu items to disable author stylesheets and everyone was able
to see their sites. They were rounded up and hanged I believe).
 
J

Jukka K. Korpela

Is it possible to hide a style sheet for all browsers?

Certainly. For example, write the style sheet only on a sheet of paper
and never show that paper to any browser. Well, better burn the paper to
be sure!

If you wanted to ask how to include a style sheet on your web page and
not include it there, then even God cannot do that. This is not a
limitation of God's power; it follows from the fact that a logically
self-contradictory description of a state of affairs does not describe
any state of affairs.

So how about telling us what you would really want to achieve?
 
J

Jukka K. Korpela

I like to hide my extern linked style sheet to protect some codes...

So this is a variant of "how do I hide my web page code". The answer is
twofold. First, you cannot. Anything that a browser can read can be read
by a human being, too, and it's not even difficult to anyone who would
know what to do with the code. Second, if you want to protect your code
from being "stolen", the odds are that even a drunken monkey wouldn't
dream of "stealing" it.

It is true that some authors are more stupid than drunken monkeys, but
then it's really their problem if they "steal" your code. You can damage
them a bit more by including misleading or plain wrong comments into
your CSS code. (You won't need to try hard. Usually when people write
any comments in CSS code, they are misleading or wrong, or become
misleading or wrong when the code is edited and the comments will be
retained as such.)
 
L

Luuk

If you wanted to ask how to include a style sheet on your web page and
not include it there, then even God cannot do that. This is not a
limitation of God's power; it follows from the fact that a logically
self-contradictory description of a state of affairs does not describe
any state of affairs.

A real believer will claim its not logical to claim this as a limitation
of Gods' power.

Because you should know that there is NO limit to God's power, and
therefore He can do so, even if it follows from the fact that a
logically self-contradictory description of a state of affairs does not
describe any state of affairs.
 
J

j

Is it possible to hide a style sheet for all browsers?

It's much easier to make them undecipherable, in fact most come that way.

It is sort of possible to make a server generated stylesheet (with the
correct Content-type) that would be hard to access as a link, but the
stylesheet contents would still be visible in any of the web developer
tools that the browser might have.

Otherwise, I agree completely with Jukka.

Jeff
 
J

Jonathan N. Little

Gordon said:
The usual response to this and to hiding the source of a web page is
that it can't be done. That may be true but I think you could
obfuscate it
<http://en.wikipedia.org/wiki/Obfuscation_(software)>. That would
protect your source from all but the most determined snoopers unless
they could use it unaltered.

First Law of Web Development:

The intrinsic value of code is inversely proportional to the effort to
hide it.
 
J

Jonathan N. Little

Gus said:
You mean something like this?

<http://tinyurl.com/kep3z79>

Obfuscated, but not hidden:

/* Hidden in plain sight */
article {
margin:auto;
font-size:100%;
width:50%;
background-color:#FFFF99;
color: red;
margin-top:10em;
padding: 0 .5em;
border:1px dashed #f00;
}

p {
text-align:center;
font-size:110%;
}
em {
color:blue;
}
#interrobang
{
Font-size:200%;
}
 
G

Gus Richter

Obfuscated, but not hidden:

Many years ago this same question arose in Blooberry's chat which is no
longer there. In fact the Blooberry site itself is no longer maintained.
In any case, I submitted a similar page as a lark back then. It turned
out, to my surprise, that everyone was very confused and asked how I did
it (without the many tools available today, there was only Notepad back
then).

I now submitted this in the same spirit. I wonder if anyone nowadays
finds this initially surprising and confusing.
 
J

Jonathan N. Little

Gus said:
Many years ago this same question arose in Blooberry's chat which is no
longer there. In fact the Blooberry site itself is no longer maintained.
In any case, I submitted a similar page as a lark back then. It turned
out, to my surprise, that everyone was very confused and asked how I did
it (without the many tools available today, there was only Notepad back
then).

I now submitted this in the same spirit. I wonder if anyone nowadays
finds this initially surprising and confusing.

No special tools required. View source has always been there that I
recall since the first Netscape Navigator...I don't know about Mosaic, I
never used it.
 
G

Gus Richter

No special tools required. View source has always been there that I
recall since the first Netscape Navigator...I don't know about Mosaic, I
never used it.

Right on. The straightforward way. But you see, many/most people
will/did not think of the scrolling part.

I was thinking more in terms of today's developer tools (e.g. Firebug)
which is overkill in this instance.
 
D

dorayme

Jonathan N. Little said:
Obfuscated, but not hidden:

/* Hidden in plain sight */
article {
margin:auto;
font-size:100%;
width:50%;
background-color:#FFFF99;
color: red;
margin-top:10em;
padding: 0 .5em;
border:1px dashed #f00;
}

p {
text-align:center;
font-size:110%;
}
em {
color:blue;
}
#interrobang
{
Font-size:200%;
}

It's actually more complicated due to browser differences. On my
Safari, both yours and Richter's just shows up in View source. In
Firefox, Richter's does not but yours does.
 
J

Jonathan N. Little

dorayme said:
It's actually more complicated due to browser differences. On my
Safari, both yours and Richter's just shows up in View source. In
Firefox, Richter's does not but yours does.

No, it all there in all browser, you have to scroll because he put
leading whitespace....it's like the folks that try to hide source with
50 or so leading carriage returns.
 
G

Gus Richter

There appears to be about 250 leading spaces in Gus's lines. When I view
source in his page with Firefox, the CSS wraps, so there is no hiding at
all. I didn't even notice the excess spacing the first time I looked, as
the CSS was right there in front of me...

Yup, browsers act differently I see. It didn't used to a bunch of years
ago. For some of them it seems to depend on the View Source Width. For
me Firefox renders as it did in the old days; nicely tucked off to the
right accessible by scrolling. In any case, this was not meant as a
serious thing, only in fun.
 
D

dorayme

Jonathan N. Little said:

Yes, OK, but in my Safari, *no horiz scrolling is needed*, the browser
sees through it and brings it all to the left and it is visible from
the get go.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top