[thelist] HTML as data structure

Mark Gallagher mark at cyberfuddle.com
Fri Aug 2 10:52:01 CDT 2002


Joel Konkle-Parker wrote:
> After reading the theory discussions here for awhile, I think I need something
> clarified. In the grand scheme of things, HTML is for structure, CSS is for
> style, and XML is for semantics, correct? So in regular HTML/CSS documents,
> there is no semantic meaning, right?

Close.  XML and HTML are both used for structure and semantics - they're
two separate markup languages.  It's like, oh, comparing PHP and Perl :-).

HTML still has semantic meaning.  For example, <p> means "paragraph".

> To write HTML in its true purpose, you should strive to simply structure the
> data, with no thought to style whatsoever. Then, you should apply style to that
> structure with CSS, without modifying the structure to facilitate style. For
> example, tables should be used exclusively for tabular data, and <span

Yes!  Well done.

> class="bold">something</span> has no structure associated with it, so the bold
> style should be applied by some other method.

If possible.  Unfortunately, sometimes you'll need to communicate
something which doesn't exist in HTML: for example, if you wish to
specify a group of elements as a menu, there's no way of saying
<content> for your main content, and <menu> for your menus.  The usual
way is to use <div>s - <div id="content"> <div id="menu">.


--
Mark Gallagher
Desperately attempting - and failing - to stay on topic since 1999
fuddleriffic - http://cyberfuddle.com/
blog - http://cyberfuddle.com/infinitebabble/




More information about the thelist mailing list