About default stylesheets...

S

spaghetti

I read that HTML has a "default stylesheet" that basically says <table>
needs to be display:table; and <strong> needs to font-weight:bolder; etc.
(http://www.w3.org/TR/REC-CSS2/sample.html)

Is this a standard, suggestion, or just a "this is what they all seem to do,
though they don't actually use stylesheets to do it?" Are there default
styles for XHTML?

Basically what I'm saying is, I understand there was some sort of standard
on how basic HTML (not XHTML/XML) should be styled. But for XHTML, isn't it
proper to assume all these XML elements don't have a default stylesheet, so
therefore must be styled explicitly in our stylesheets? Like doing the basic
stuff like table{display:table;} etc.?

I'm just confused. I assumed XML was unstyled, and XHTML is technically XML:
it is just using old HTML-style tags to take advantage of the default
rendering standards of HTML in old browsers. But since it's really truly
just XML, aren't we supposed to be styling all that stuff ourselves?

Just a weird thing I was wondering about....
 
D

David Dorward

spaghetti said:
I read that HTML has a "default stylesheet" that basically says <table>
needs to be display:table; and <strong> needs to font-weight:bolder; etc.
(http://www.w3.org/TR/REC-CSS2/sample.html)

Is this a standard, suggestion, or just a "this is what they all seem to
do, though they don't actually use stylesheets to do it?"

As the page says "This style sheet describes the typical formatting of all
HTML 4.0 ([HTML40]) elements based on extensive research into current UA
practice." - this means it is "what they all seem to do".

It would make sense for a browser to implement that as a default style sheet
for legacy documents, but most browsers have left over legacy rendering
engines from the pre-CSS days.
Are there default styles for XHTML?

Yes. XHTML is just HTML expressed using XML rather then SGML.
Basically what I'm saying is, I understand there was some sort of standard
on how basic HTML (not XHTML/XML) should be styled. But for XHTML, isn't
it proper to assume all these XML elements don't have a default
stylesheet, so therefore must be styled explicitly in our stylesheets?
Like doing the basic stuff like table{display:table;} etc.?

I'm just confused. I assumed XML was unstyled, and XHTML is technically
XML: it is just using old HTML-style tags to take advantage of the default
rendering standards of HTML in old browsers. But since it's really truly
just XML, aren't we supposed to be styling all that stuff ourselves?

No. XHTML is still HTML and it makes sense to have a default style sheet.
"XML" doesn't have a default style sheet because its too generic. There
isn't much point in having a default style sheet for a language which
doesn't have predefined tags to apply the styles too.
 
J

Jukka K. Korpela

spaghetti said:
I read that HTML has a "default stylesheet" that basically says
<table> needs to be display:table; and <strong> needs to
font-weight:bolder; etc.
(http://www.w3.org/TR/REC-CSS2/sample.html)

It doesn't really say that "HTML has" it.
Is this a standard, suggestion, or just a "this is what they all
seem to do, though they don't actually use stylesheets to do it?"

Well, what does the document itself say? It should not be taken at face
value, but it's not very far from truth. The "sample" style sheet is
explicitly labeled informative, not normative, yet the text is rather
suggestive and looks like a recommendation (within a recommendation).
It by and large corresponds to browser practices, but there are many
differences.
Are there default styles for XHTML?

XHTML 1 is HTML 4 with a somewhat distorted syntax. No differences that
would affect visual rendering and style sheets.
Basically what I'm saying is, I understand there was some sort of
standard on how basic HTML (not XHTML/XML) should be styled.

No, that would be very odd, wouldn't it? Unless you mean browser's
default style sheet, which is lowest in precedence.
But
for XHTML, isn't it proper to assume all these XML elements don't
have a default stylesheet, so therefore must be styled explicitly
in our stylesheets?

No, XHTML is HTML, just with restrictions and complications. XML is
something different. For rendering XML, you surely need a style sheet
that specifies everything, or an equivalent.
I'm just confused.

No wonder. Too many X's.
I assumed XML was unstyled,

Basically yes.
and XHTML is technically XML:

Well, it's XML too, via kludgery and adhockery. But its elements have
defined meanings, and this distinguishes it from XML itself.
it is just using old HTML-style tags to take
advantage of the default rendering standards of HTML in old
browsers.

In a sense yes.
But since it's really truly just XML, aren't we supposed
to be styling all that stuff ourselves?

No. It's sort-of XML, which simply means syntax, syntax, and syntax,
with nothing about meaning. But it's sort-of HTML too, and this assigns
some meanings and makes it possible to browsers to apply default
rendering rules.
 
C

Chris Morris

Jukka K. Korpela said:
regarded as XML documents. I wonder what happens if you take an XHTML
document and throw it at a browser, saying "here's some yummy
text/xml". In principle, we might expect the browser to ignore
everything it ever learned about HTML and render the content strictly
according to the style sheet that you specify. In practice, I'm not
holding my breath.

Actually, the support seems fairly decent...

Galeon based on Mozilla 1.3:
No stylesheet: Displays document tree
<style> stylesheet: Tree
<link/> stylesheet: Tree
<?xml-stylesheet?>: Uses stylesheet

Opera 5,6,7:
No stylesheet: Unstyled (everything inline, normal text)
<style> stylesheet: Unstyled
<link/> stylesheet: Unstyled
<?xml-stylesheet?>: Uses stylesheet

IE 6:
No stylesheet: Tree
<style> stylesheet: Tree
<link/> stylesheet: Tree
<?xml-stylesheet?>: Uses stylesheet

Netscape 7 based on Mozilla 1.0:
No stylesheet: Unstyled
<style> stylesheet: Unstyled
<link/> stylesheet: Unstyled
<?xml-stylesheet?>: Uses stylesheet

IE 5 (Mac):
No stylesheet: Treats as HTML, default styles
<style> stylesheet: Treats as HTML, applies styles from sheet on top
<link/> stylesheet: Treats as HTML, applies styles from sheet on top
<?xml-stylesheet?>: Uses stylesheet, does *not* treat as HTML, so no
browser styles.

NS4, Lynx, Links:
All: Asks for an external viewer for XML files.

W3M:
All: Displays as if it were text/plain
 
S

spaghetti

Yes, my questions never stop! :(

Jukka K. Korpela said:
It would be rather
difficult to draw the distinction between abstract and concrete, if
they are manifested exactly the same way.

So basically HTML elements give alot of metadata, even if elements
themselves are rendered similarly or whatever.
then it does not matter that your XML tags have
no meaning to anyone but you. And this seems to be the way that many
people look at things. The wheel is being reinvented, and it'll be a
primitive model, if not rectangular. (But it'll be popular, since
quality typesetting is so difficult.)

So basically the trend is that we don't care about all that understood
metadata of HTML tags in favor of the flexibility of XML for the author?
What about stuff like the "modular" XHTML? Is that there to build off the
meanings of HTML tags while allowing the addition of custom tags that have
no meaning at all?
Actually some of the difficulties in using XHTML arise from the
recommended (or even required) use of the monstrous media type
application/xhtml+xml.

I guess I'm pretty stupid, but why are HTML documents that are written as
XML considered an "application?" This has always kept me wondering...
natural, if we take seriously the idea that XHTML documents can be
regarded as XML documents. I wonder what happens if you take an XHTML

Actually it works pretty good as Chris Morris demonstrated... which just
confuses me even more!
 
J

Jukka K. Korpela

spaghetti said:
So basically the trend is that we don't care about all that
understood metadata of HTML tags in favor of the flexibility of XML
for the author?

That seems to be the trend. And some day the original idea of HTML will
be reinvented. Under some fancy name, probably.
What about stuff like the "modular" XHTML?

Controlled confusion. The practical reason is probably that the future
development of _a_ markup language turned out to be too difficult, so
it was split into parts. Similar phenomenon has occurred in the CSS
front. Naturally there are good explanations to all this, but I think
the real explanation is that people just gave up and wishfully think
that the pieces will magically fit together.
I guess I'm pretty stupid, but why are HTML documents that are
written as XML considered an "application?"

There are two separate issues here. The _media type_ is classified into
major type "application" for some mystical reason - that type should be
used basically for binary formats of data, intended for processing
using specific software. So much for universality.

The other issue is that traditionally the SGML world has called
document _formats_ like HTML "applications". I guess it's just part of
the somewhat odd SGML terminology. SGML is a metanotation for defining
the syntax of various notations, so the latter could be called
"applications" of the metanotation.
 
S

spaghetti

Jukka K. Korpela said:
That seems to be the trend. And some day the original idea of HTML will
be reinvented. Under some fancy name, probably.

:( So making sure our documents use the right conventions for specific bits
of text is gonna be pointless in the future?
Controlled confusion. The practical reason is probably that the future
development of _a_ markup language turned out to be too difficult, so
it was split into parts. Similar phenomenon has occurred in the CSS

So now we'll have several seperate markup languages that we can combine to
make a big big markup language? But these languages won't necessarily have
"meaning" like HTML?
The other issue is that traditionally the SGML world has called
document _formats_ like HTML "applications". I guess it's just part of
the somewhat odd SGML terminology. SGML is a metanotation for defining
the syntax of various notations, so the latter could be called
"applications" of the metanotation.

Okay that seems a little stupid to me. But whatever!
 

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,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top