Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Machine readable HTML and CSS spec?

is there a XML or JSON resource I can parse in Javascript that tells me what HTML elements there are, what their attributes are and what CSS styles I can apply? I want to have a list of valid options without typing in everything by hand.

Please bear with me here, I'm new to this web stuff but have plenty experience in C (mostly game engines).

TIA!

like image 817
user2983816 Avatar asked Oct 24 '25 11:10

user2983816


1 Answers

(X)HTML before version 5 have DTDs that you can parse (you can get the URLs for them from the Doctype for the version of (X)HTML you are working with.

HTML 5 doesn't have an official machine readable spec. You might be able to extract something useful from the validator.nu source code though.

The CSS properties that can be applied to an element depend only on what other CSS properties have bee applied to it. Their only connection to HTML is that the browser's default stylesheet applies some properties automatically.

like image 161
Quentin Avatar answered Oct 27 '25 00:10

Quentin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!