Re: A new JavaScript tutorial(Beta)
- From: "Richard Cornford" <Richard@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 7 Sep 2005 00:52:34 +0100
binnyva@xxxxxxxxx wrote:
<snip>
>> ... actual errors mostly relate to the discussion and examples of
>> (X)HTML mark-up. This is well illustrated by this section opening
>> paragraphs:-
>> JavaScript or JScript is a language that can be seen as the next
> step
>> from HTML. HTML is concerned with the simple display and
> presentation of
>> text and images. JavaScript offers more interactivity for the user
> and
>> above all more choice and understanding of the world wide web.
You have really garbled that quote (and failed to attribute it
correctly). You might want to read the group's FAQ as it references
information on effectively formatting newsgroup posts.
> Hmm. How should I change the text to make the description better?
Replace and/or re-order the words to produce a result that is more
meaningful and accurate.
>> -, the many examples of invalid mark-up, and particularly this
> section:-
>>
>> If you are serious about web development, you should know these
>> two tags very well - they have awesome powers. These tags in
>> alliance with CSS are currently posing a great threat to the other
>> tags. If these two tags and CSS had their way, many old and
>> obsolete tags would die - the first to go will be the font tag.
>> Next in line will be other tags like b(bold) - will be replaced
>> by <strong>, i(italics) - to be replaced by <em>, etc. I have even
>> heard reports that div is going to replace the old(and faithful)
>> table tag in layout! These tags with some others are promising and
>> to bring about the HTML utopia - the separation of design
>> content.
>>
>> Which demonstrates an apparent absence of technical understanding
>> of HTML mark-up.
>
> Again, how do I make the description better?
The statements that you actually made stem form fundamental
misconceptions as to the nature of HTML. Including an apparent
unawareness of the technical aspects of the language, so when you
wrote:-
| So when do you use SPAN and when do you use DIV? Use DIV if you
| want do enclose lengthy contents or if the enclosed text will
| have HTML tags in them. Use span for enclosing very small contents.
- you disregard HTML's rules about the permissible contents of its
various elements. And so deprive your readers of the opportunity to
appreciate the relative roles of inline elements and block elements.
> Or should I just remove the offending para - this
> is just a side note - so I can safely delete it.
That paragraph may be the nadir of the article, but removing it would
not solve my issue with it. The preceding mark-up:-
| <div class="thequote">I accidentally shot my father-in-law
| while deer hunting. It was an <u>honest</u> mistake.
| I came out of the tent in the morning and thought <b>I saw
| a deer in an orange vest making coffee</b>.<br />
| <span class="quoter">Steven Wright</span></div>
- betrays strange reasoning. You seem to want to apply CSS styling to a
block level element containing a quote. HTML has a BLOCKQUOTE element
which is block level and to which any CSS styling can be applied. It is
a semantic element, its name actually says something about the contents
of the element, and what is says seems to correspond precisely with the
role you have assigned to the DIV you are proposing in its place.
And instead of applying CSS as:-
| div.thequote {
| border:1px dashed black;
| padding-left:50px;
| padding-right:50px;
| }
- you could apply it as:-
BLOCKQUOTE {
border:1px dashed black;
padding-left:50px;
padding-right:50px;
}
- and have that CSS apply to all block level quotes, or use that as a
default block quote styling and use classes to categorise any special
types of block level quotes, and apply styling to those. E.G:-
BLOCKQUOTE.hyperbole {
font-weight:bold;
font-size:120%;
}
DIV and SPAN are semantically neutral elements, they are useful
(especially in conjunction with class attributes used for
classification) in extending HTMLs limited set of semantic elements. But
where other elements are available to describe the contents they should
not be used in preference. In this respect your use of SPAN to
categorise the individual being quoted is much more appropriate (even if
the class chosen is flawed).
Their role in purely structural grouping, especially when used to apply
layout, is a slightly different matter. For example, The name "Steven
Wright" is not part of the quote so maybe it should not be inside a
BLOCKQUOTE element, but you would want it grouped with the BLOCKQUOTE,
and laid out in association with it, which might result in:-
<div class="attributedQuote">
<blockquote>
<p>I accidentally shot my father-in-law while deer hunting.
It was an <em>honest</em> mistake. I came out of the tent in
the morning and thought <strong>I saw a deer in an orange
vest making coffee</strong>.</p>
</blockquote>
<div class="quoteAttribution">Steven Wright</div>
</div>
> Just give me some suggestions on how to make the
> above descriptions better.
Learn some HTML, and how to apply CSS to it.
> I am not correcting this myself - if my first attempt
> did not make the mark, I don't expect much of the second attempt.
<snip>
I always expect more of my second (and subsequent) attempts to explain
anything. I expect to have learnt more in the interim, taken account of
critical feedback and observed the effectiveness of the explanation on
whoever it is directed towards.
Richard.
.
- Follow-Ups:
- Re: A new JavaScript tutorial(Beta)
- From: Dr Clue
- Re: A new JavaScript tutorial(Beta)
- References:
- A new JavaScript tutorial(Beta)
- From: binnyva
- Re: A new JavaScript tutorial(Beta)
- From: Robi
- Re: A new JavaScript tutorial(Beta)
- From: Richard Cornford
- Re: A new JavaScript tutorial(Beta)
- From: binnyva
- A new JavaScript tutorial(Beta)
- Prev by Date: Re: Selecting all items in a multiple select: inconsistency with Internet Explorer
- Next by Date: Re: Code Samples
- Previous by thread: Re: A new JavaScript tutorial(Beta)
- Next by thread: Re: A new JavaScript tutorial(Beta)
- Index(es):
Relevant Pages
|