Intro to HTML & Semantic Markup (Chapter 2 - Sorta Brief Version)
02 intro to markup
-
Upload
rap-payne -
Category
Technology
-
view
285 -
download
2
description
Transcript of 02 intro to markup
![Page 1: 02 intro to markup](https://reader034.fdocuments.net/reader034/viewer/2022052504/5495c118ac7959342e8b4f4a/html5/thumbnails/1.jpg)
Intro to *ML … because HTML is a markup language
![Page 2: 02 intro to markup](https://reader034.fdocuments.net/reader034/viewer/2022052504/5495c118ac7959342e8b4f4a/html5/thumbnails/2.jpg)
A domain-specific language is a computer language that only applies in certain, narrow situations
Language Context
SQL For reading/writing databases
RegEx For matching patterns
HTML For drawing web pages
XML For storing flexible data in flat files
make or rake For compiling projects in an organized way
![Page 3: 02 intro to markup](https://reader034.fdocuments.net/reader034/viewer/2022052504/5495c118ac7959342e8b4f4a/html5/thumbnails/3.jpg)
Markup languages separate annotations from data � Usually through "tags" <firstName>Chris</firstName>!� Descriptive markup ◦ What kind/type/domain of data is in the tag
� Procedural markup ◦ A subroutine or procedure to run
� Presentation markup ◦ How to render the data
![Page 4: 02 intro to markup](https://reader034.fdocuments.net/reader034/viewer/2022052504/5495c118ac7959342e8b4f4a/html5/thumbnails/4.jpg)
SGML is the original standard
� HTML and XML conform to it � Pioneered the idea of tags demarcating data
![Page 5: 02 intro to markup](https://reader034.fdocuments.net/reader034/viewer/2022052504/5495c118ac7959342e8b4f4a/html5/thumbnails/5.jpg)
HTML is the language of the web
� Regular UTF/ASCII characters sent from the server to the browser
� The browsers are written to know how to render the HTML
![Page 6: 02 intro to markup](https://reader034.fdocuments.net/reader034/viewer/2022052504/5495c118ac7959342e8b4f4a/html5/thumbnails/6.jpg)
XML is a form of SGML that is used to communicate data between systems
It needs to be � Well-formed � Valid
![Page 7: 02 intro to markup](https://reader034.fdocuments.net/reader034/viewer/2022052504/5495c118ac7959342e8b4f4a/html5/thumbnails/7.jpg)
Well-formed XML has many rules like … � It has a single root element � All tags are closed or self-closing � Tags can nest, but not overlap � Tags are alphanumeric and case-sensitive � Attributes are quoted
![Page 8: 02 intro to markup](https://reader034.fdocuments.net/reader034/viewer/2022052504/5495c118ac7959342e8b4f4a/html5/thumbnails/8.jpg)
HTML is not XML but should follow most rules of well-formedness � Okay <div>Best. Company. <style="color: red;">Ever</style>!</div>!
� Not okay <div>Best. Company. <style="color: red;">Ever</div></style>!!
![Page 9: 02 intro to markup](https://reader034.fdocuments.net/reader034/viewer/2022052504/5495c118ac7959342e8b4f4a/html5/thumbnails/9.jpg)
Hands-on well-formedness
![Page 10: 02 intro to markup](https://reader034.fdocuments.net/reader034/viewer/2022052504/5495c118ac7959342e8b4f4a/html5/thumbnails/10.jpg)
Conclusion
� HTML, a form of SGML is the language that web servers send to browsers
� The browsers use HTML to make the pages look good because the browsers know how to render the HTML
� The HTML should be well-formed, but if it isn't the browser still does its best to render
![Page 11: 02 intro to markup](https://reader034.fdocuments.net/reader034/viewer/2022052504/5495c118ac7959342e8b4f4a/html5/thumbnails/11.jpg)
Further study