5 ms·
Google prefers JSON-LD though[0]. Also I'm not keen on defining content with styling classes. [0] https://www.searchenginejournal.com/google-structured-data-pr
by sleepyhead 4y ago
Google prefers JSON-LD though[0]. Also I'm not keen on defining content with styling classes.
[0] https://www.searchenginejournal.com/google-structured-data-preference/297479/#close https://www.searchenginejournal.com/google-structured-data-p...
- lawtalkinghuman 4y agoThe class attribute isn't just for styling though. See https://html.spec.whatwg.org/multipage/dom.html#global-attributes:classes-2 https://html.spec.whatwg.org/multipage/dom.html#global-attri... > authors are encouraged to use values that describe the nature of the content, rather than values that describe the desired presentation of the content.
- sleepyhead 4y agoTIL! So those obnoxious JavaScript frameworks using classes for declaring logic are actually valid???!!
- sleepyhead 4y ago> values that describe the nature of the content vs > rather than values that describe the desired presentation of the content. Or could it be that the meaning here is that you should write descriptive classes such as 'alert-box' instead of 'red-box'.
- oneeyedpigeon 4y agoBut that gets your "not just for styling" property for free — now another component can use the knowledge that the element is an alert box.
- jamietanna 4y agoAs mentioned in https://www.jvt.me/posts/2020/03/02/google-microformats-support/ https://www.jvt.me/posts/2020/03/02/google-microformats-supp... Microformats are still a recommended route
- sleepyhead 4y agoNot recommended but supported. JSON+LD is recommended. See https://developers.google.com/search/docs/advanced/structured-data/intro-structured-data https://developers.google.com/search/docs/advanced/structure...