There were no semantic tags in HTML4?

245 Views Asked by At

I know semantic tags were added in HTML5.

So isn't the table tag in HTML4 not a semantic tag?

Can only tags such as header, section, article, etc. added in HTML5 be called semantic tags?

I'm really curious.

4

There are 4 best solutions below

1
On

I wouldn’t say that there were no semantic elements in HTML 4 and before. It’s more that they were mixed with elements that control visual presentation, like <font>.

Also <h1> and other heading elements were already around, that are clearly semantic. Most notably the <form> related tags are purely semantic, and as you say, the <table>.

After 1996, with CSS, separation of concerns between visual presentation and document structure became achievable, hence the push towards more semantics in HTML 5 and against presentation-tags.

The Accessibility Tree is another proof that HTML 4 already had semantics.

It is generated from HTML (from the DOM), and serves exclusively for conveying document and interaction semantics to users of assistive technology. The first accessibility guidelines were from the early 2000s, so they were based on HTML 4.

3
On

I know semantic tags were added in HTML5.

HTML 5 did add new semantic elements

So isn't the table tag in HTML4 not a semantic tag?

Incorrect. It is a semantic element.

Can only tags such as header, section, article, etc. added in HTML5 be called semantic tags?

No.


Semantic elements have always been part of HTML.

HTML 4 was notable in that it did a lot of work cleaning up the semantic features of the language (e.g. deprecating font and center).

0
On

well Semantic html is html that introduces meaning to the web page rather than just presentation. For example, a <p> tag indicates that the enclosed text is a paragraph. This is both semantic and presentational because people know what paragraphs are, and browsers know how to display them. A semantic element clearly describes its meaning to both the browser and the developer. here you can see html5 semantic elements https://webflow.com/blog/html5-semantic-elements-and-webflow-the-essential-guide

considering that CSS wasn’t introduced until the end of 1996 styling options were very limited developers found solutions by building the interface layout using tables. As CSS matured the table-based layout was replaced by the based layout, which allegedly solved the semantic contradiction in the cases that layout was conveyed as table data. so it is safe to say that table in html4 was a semantic element. you can also check the link below to read more about it: https://www.evinced.com/blog/its-just-a-matter-of-semantics/

0
On

HTML5 does not have semantic tags in the meaning of "semantic web" ("data-first web"). HTML5 contains "semantic" tags in the meaning of a graphical user interface (more specifically, a hypertext-oriented interface). Some tags, such as <address>, are more "semantic" than interface markup tags, but this is more of an exception. So, if the HTML would contain really semantic tags, the markup would be something like this (but it would no longer be called a HyperText Markup Language):

<products>
    <product>
        <name>Printer</name>
        <price>100</price>
    </product>
    <product>
        <name>Notebook</name>
        <price>200</price>
    </product>
</products>

With something like this CSS:

.products {
    display: table;
}
.products .product {
    display: table-row;
}
.products .product * {
    display: table-cell;
}

And a query to search engine would be very handy: select product from products where product.price <= 200.