bj*****@xs1.xs4all.nl (Bauke Jan Douma) wrote in message news:<40***********************@news.xs4all.nl>...
I noticed that you can define a style, e.g.:
x {color: green; font-weight: bold}
and then use <x> and </x> tags in your body. How convenient!
This isn't permitted.
Don't mess with the tags in HTML. Use the set you were given and no
others.
If you _really_ want to do this, then switch to XHTML and use XML
namespacing. This is now perfectly valid (as XML), but it stretches
the boundaries of what's seen as acceptable HTML by most browsers and
validators. It'll give you problems.
The real way to do this is with compliant HTML, using the <span> and
<div> elements, but add a class attribute to them. You now have code
like this:
.x {color: green; font-weight: bold; }
<p>A paragraph with a <span class="x" >green</a> word.</p>
To make this work well, red the HTML specification and the DTD, and
get the distinction cleaqr in your mind about <span>, <div> and the
difference between block and inline elements.