469,306 Members | 1,578 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

type="text/css" (?)

Is the link rel="stylesheet" supposed to be real plain text,
or would some word processor format such as Word/Pad work?

This sample stylesheet seems garbled if downloaded and
opened with Notepad, but seems to view right in browser.
Could this be a problem, or cause slow loading when applied?

A link for this sample "style.css" is on
http://users.ntplx.net/~richw/
Thanks for any advice, Rich
Jan 31 '06 #1
7 2067
Rich wrote:

This sample stylesheet seems garbled if downloaded and
opened with Notepad, but seems to view right in browser.
Could this be a problem, or cause slow loading when applied?

The file uses only a linefeed character as a newline indicator, likely
generated on a unix-ish environment. Notepad is too stupid to realize
that; it expects a carriage-return/line-feed pair as a newline.
There is no performance effect whatsoever. (Well, loading time is
microscopically faster since there is one char instead of two for each
newline.)

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jan 31 '06 #2
Stylesheets do use plain text format, not some bizarre word processor
encoding (as you imagine). Complications occasionally arise because
different platforms encode new lines in text files differently.

For example, for a newline UNIX writes just a line feed (LF) control
character, Mac writes a carriage return (CR) control character, and DOS
writes both CR & LF control characters.

The effect you see in Notepad, where all the text is in one long
wrapped line, with little box characters in between, is because the
newlines are encoded differently from how Notepad expects. Perhaps
"style.css" was authored on another platform?

Notepad is primative.
Wordpad's a bit smarter with newline handling.
You can use Wordpad to view & edit the file, providing you save the
file as text.

Tasman

Rich wrote:
Is the link rel="stylesheet" supposed to be real plain text,
or would some word processor format such as Word/Pad work?

This sample stylesheet seems garbled if downloaded and
opened with Notepad, but seems to view right in browser.
Could this be a problem, or cause slow loading when applied?

A link for this sample "style.css" is on
http://users.ntplx.net/~richw/
Thanks for any advice, Rich


Jan 31 '06 #3
Tasman wrote:
Stylesheets do use plain text format,


Technically, a CSS stylesheet is not _plain_ text (media type
text/plain) but of type text/css.

The definition of text/css does not specify how line breaks are to be
represented, and it does not need to, since a line break is just white
space in CSS syntax, see
http://www.w3.org/TR/REC-CSS2/syndata.html#syntax

Thus, whether you use Carriage Return, Line Feed, or space, or any
sequence of these, the meaning of a style sheet does not change. The
visual rendering of a style sheet, when viewed e.g. in a text editor,
might be affected, but that's external to CSS.
Jan 31 '06 #4
Tue, 31 Jan 2006 01:08:09 -0500 from Rich <ri***********@ntplx.net>:
Is the link rel="stylesheet" supposed to be real plain text,
or would some word processor format such as Word/Pad work?


I don't know what "Pad" might be, but if by "Word" you mean Microsoft
Word then its native format is _not_ suitable for text/css. You can
export plain text in the File >> Save As dialog, but why not just use
a decent text editor to begin with?

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/200..._wont_help_you
Jan 31 '06 #5
Rich <ri***********@ntplx.net> wrote in news:43DEFEC9.690E0656
@ntplx.net:
Is the link rel="stylesheet" supposed to be real plain text,
or would some word processor format such as Word/Pad work?

This sample stylesheet seems garbled if downloaded and
opened with Notepad, but seems to view right in browser.
Could this be a problem, or cause slow loading when applied?


Is it garbled or just has a strange character occasionally while
everything is on one line? I suspect it is a Unix file that uses
slightly different end of line notation (one character rather than two
as in DOS/Windows). But yes, it is a plain text file. Try a better
editor such as Crimson (http://www.crimsoneditor.com/) and it should
display as it should. Notepad sucks.

--
Stan McCann "Uncle Pirate" http://stanmccann.us/pirate.html
Webmaster/Computer Center Manager, NMSU at Alamogordo
http://alamo.nmsu.edu/ There are 10 kinds of people.
Those that understand binary and those that don't.
Jan 31 '06 #6
Rich wrote:
A link for this sample "style.css" is on
http://users.ntplx.net/~richw/
Thanks for any advice, Rich


And then ... you need to rethink your usage of fixed font sizes. IE will
not allow visitors with visual disabilities to resize your micro fonts.
Use percentages, 100 of them for normal content, larger for <hx>
elements and slightly smaller for legalese, maybe 85%.

Drop Verdana.
http://xs4all.nl/~sbpoley/webmatters/verdana.html

Your entire style sheet could be about half the size if you didn't
repeat everything. The C of CSS is Cascading.

--
-bts
-Warning: I brake for lawn deer
Jan 31 '06 #7
"Beauregard T. Shagnasty" wrote:

Rich wrote:
A link for this sample "style.css" is on
http://users.ntplx.net/~richw/
Thanks for any advice, Rich


And then ... you need to rethink your usage of fixed font sizes. IE will
not allow visitors with visual disabilities to resize your micro fonts.
Use percentages, 100 of them for normal content, larger for <hx>
elements and slightly smaller for legalese, maybe 85%.

Drop Verdana.
http://xs4all.nl/~sbpoley/webmatters/verdana.html

Your entire style sheet could be about half the size if you didn't
repeat everything. The C of CSS is Cascading.

--
-bts
-Warning: I brake for lawn deer


Thank you all for the education. This is part of a complex site
with MS-asp/database config. purchased by our non-profit. I have
just been trying to figure it out. Will pass on the ideas to our
webmaster. Cheers Rich ctrivers.org
Feb 1 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by j.t.w | last post: by
9 posts views Thread by Arash Dejkam | last post: by
3 posts views Thread by Silmar | last post: by
1 post views Thread by i_dvlp | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.