Post History
In my book, Structured Writing: Rhetoric and Process, I make a distinction between three domains of markup, the subject, document, and presentation domain. CSS is a presentation domain language. HT...
Answer
#2: Post edited
- In my book, [Structured Writing: Rhetoric and Process](https://xmlpress.net/publications/structured-writing/), I make a distinction between three domains of markup, the subject, document, and presentation domain. CSS is a presentation domain language. HTML was originally a mess of document and presentation domain with a the odd bit of subject domain thrown in. The intention now is to make it more or less a pure document domain language, let XML define subject-domain languages, and use CSS as the presentation domain language.
- `<code>` is a funny tag, because it has meaning in all three domains. But in this context it makes the most sense to treat it as a document domain tag. In other words, it says that a certain piece of text is to be treated as code, but does not say how it is to presented.
- Thus using `<code>` in the HTML and then styling it appropriately in CSS maintains these distinctions.
- Complexity can arise if you have different types of code that you want to format differently. This is really getting into the subject domain, but unless you want to go full XML, you will probably want to handle this in the HTML. This is where the sytle attribute can come in handy, allowing you to say `<code class="visual basic">`.
But I see no virtue in using `<td class="code">`, which is really confusing two things. The table sell is not code. The content of the cell is code, so it is the content that should be tagged as code.Good markup practice in every domain is too mark something up as what it actually is. Markup that achieves the desired effect while mislabeling things is apt to cause problems down the road. And that is the formal argument too back up your preference, which is absolutely correct.
- In my book, [Structured Writing: Rhetoric and Process](https://xmlpress.net/publications/structured-writing/), I make a distinction between three domains of markup, the subject, document, and presentation domain. CSS is a presentation domain language. HTML was originally a mess of document and presentation domain with a the odd bit of subject domain thrown in. The intention now is to make it more or less a pure document domain language, let XML define subject-domain languages, and use CSS as the presentation domain language.
- `<code>` is a funny tag, because it has meaning in all three domains. But in this context it makes the most sense to treat it as a document domain tag. In other words, it says that a certain piece of text is to be treated as code, but does not say how it is to presented.
- Thus using `<code>` in the HTML and then styling it appropriately in CSS maintains these distinctions.
- Complexity can arise if you have different types of code that you want to format differently. This is really getting into the subject domain, but unless you want to go full XML, you will probably want to handle this in the HTML. This is where the sytle attribute can come in handy, allowing you to say `<code class="visual basic">`.
- But I see no virtue in using `<td class="code">`, which is really confusing two things. The table cell is not code. The content of the cell is code, so it is the content that should be tagged as code.
- Good markup practice in every domain is to mark something up as what it actually is. Markup that achieves the desired effect while mislabeling things is apt to cause problems down the road. And that is the formal argument too back up your preference, which is absolutely correct.
#1: Initial revision
In my book, [Structured Writing: Rhetoric and Process](https://xmlpress.net/publications/structured-writing/), I make a distinction between three domains of markup, the subject, document, and presentation domain. CSS is a presentation domain language. HTML was originally a mess of document and presentation domain with a the odd bit of subject domain thrown in. The intention now is to make it more or less a pure document domain language, let XML define subject-domain languages, and use CSS as the presentation domain language. `<code>` is a funny tag, because it has meaning in all three domains. But in this context it makes the most sense to treat it as a document domain tag. In other words, it says that a certain piece of text is to be treated as code, but does not say how it is to presented. Thus using `<code>` in the HTML and then styling it appropriately in CSS maintains these distinctions. Complexity can arise if you have different types of code that you want to format differently. This is really getting into the subject domain, but unless you want to go full XML, you will probably want to handle this in the HTML. This is where the sytle attribute can come in handy, allowing you to say `<code class="visual basic">`. But I see no virtue in using `<td class="code">`, which is really confusing two things. The table sell is not code. The content of the cell is code, so it is the content that should be tagged as code. Good markup practice in every domain is too mark something up as what it actually is. Markup that achieves the desired effect while mislabeling things is apt to cause problems down the road. And that is the formal argument too back up your preference, which is absolutely correct.