|
|
|
|
|
by mushyhammer
1534 days ago
|
|
Contrary to popular belief, HTML and CSS are unrelated. If any CSS property was also an HTML attribute, any addition to either spec would have to make sure it wouldn’t conflict. One example is the `content` HTML attribute and CSS property. They serve different purposes and have a completely different syntax. <meta name="description" content="Cool stuff”>
and .css::before {
content: url(image.bmp)
}
|
|
Sorry but I think you guys/gals don't get it - the question is why do we need two item-value syntaxes. Like, HTML has 'bgcolor=black' as markup attribute, and owing to SGML, the effective value for that attribute can be defaulted, inherited, and assigned in a context-dependent way. Those mechanisms aren't directly part of HTML because they don't need to be when it's understood that HTML as an SGML application can of course make use of all the authoring mechanism SGML has. But then comes CSS and defines an entirely new syntax that's almost the same (eg. "background: #000"). How is that helpful?
To say it in another way: let's assume we want web pages in 3D space, and yes I know z-index and CSS parallax effect are a thing so bear with me. Following the CSS logic, we should tunnel a background depth/z coordinate via CSS-in-HTML, like
where I deliberately have chosen ad-hoc characters for the item/value separator and multiple-properties separator to make the point.You know, having a common meta syntax for elements/attributes is the entire point of SGML as a text format after all ;)