473,386 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 2273
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: j.t.w | last post by:
Hi All. I'm having a problem with my Date of Birth textbox. When I open the ..htm file, the "DoB" textbox is flat with a border. All of my other textboxes are sunken and are yellow. When I...
1
by: Neil Zanella | last post by:
Hello, I would like to use CSS to apply a width of 100% to all <input> elements, but to only those that have an type attribute set to "text", without affecting check boxes, radio buttons, etc......
9
by: Arash Dejkam | last post by:
Hi All, Is it possible to write on an <OBJECT type="text/html"> using document.write() from within the html containing that tag the way we write on a popup window? I couldn't do that after a lot...
9
by: David D. | last post by:
Does the file extension matter when including a JavaScript file in an HTML page? Normally, one would include a JavaScript file in an HTML page using <script src="foo.JS" type="text/javascript">...
3
by: Silmar | last post by:
Hi! In my form I have table which cells contain input objects of type="text" which initially are disabled. I would like to activate them by clicking on them. However because input object does...
6
by: Jon Davis | last post by:
I recently learned how to do an <OBJECT> alternative to <IFRAME> in current browsers using: <object id="extendedhtml" type="text/html" data="otherpage.html" width="250" height="400"></object> ...
1
by: i_dvlp | last post by:
I'm attempting to size a table and its proving to be difficult, when the <td> contain input type="text" It seems any width spec using <col width="50"> works fine, but only when it applies to...
3
by: joe | last post by:
Is it OK to have multiple: <script type="text/javascript" src="funcs1.js"></script> <script type="text/javascript" src="funcs2.js"></script> <script type="text/javascript"...
9
by: Steve | last post by:
Hi; I've being going through some legacy code on an old JSP site I have been patching. I noticed that when I save the JSP down to my PC as an HTML file I get this javascript error in IE 6 ( ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.