Key Difference Between HTML and SGML
HTML stands for HyperText Markup Language and SGML stands for Standard Generalized Markup Language. HTML is used for creating the webpage or web application design while SGML is a standard for defining generalised markup languages for the documents. HTML is a markup language means the language which is made of tags or elements so through html language we creates the webpage. The latest vesion of html is HTML5 which have two types of elements i.e. semantic and non-semantic elements. semantic elements like <header> <footer> <nav> <section> <arcticle> <aside> etc while non-semantic elements likes <div>, <span>. semantic elements represents all it's content clearly while non-semantic elements represents nothing about it's content. so HTML is the markup language which is based on SGML but has some differences.
What is HTML?
HTML stands for HyperText Markup Language. The HyperText means the text which is not a general text, it's hyper that is different from normal text and the link which is connected to another webpage. Markup Language Means the language which is made by Tags(also called elements). The Html tags having their attributes and web browsers are used to render the HTML tags and attributes.
<!DOCTYPE html><html><head><title>The Basic HTML Structure</title><meta name="description" content=""/><meta name="keywords" content=""/><meta name="robots" content="index, follow" /><link rel="stylesheet" type="text/css" href="PUT_YOUR_CSS_FILE_NAME_HERE" ></head><body><h1>The Largest Heading</h1><p>This is paragraph</p><b>This is bold text</b><i>This is italic text</i><u>This is underline text</u></body></html>
The Output of Above HTML Code
- <!DOCTYPE html> Tag used to tell the browser about HTML Version.
- <html> Tag used to define the root of HTML document.
Note: We should always define the attribute of <html> tag for language like <html lang="en">(en means english).
- <title> Tag content show in browsers tab.
- <meta> Tags are used for search engine's crawler to tell the information about the webpage.
- <link> Tags are used to linking any external file to the current HTML document.
- <body> Tag is used to defining the body of document which content shows in the browser.
- <h1> is the largest heading.
- <p> Tag is used to define the paragraph.
- <b> Tag is to represent the bold content in the document.
- <i> Tag is to represent the italic content in the document.
- <u> Tag is to represent the underline content in the document.
Every HTML file start from <!DOCTYPE html> which is declared at the top of document so <!DOCTYPE html> tells the browser about the HTML version. After that we write <html> tag and then <head> tag, inside <head> tag we writes all the meta tags(for search engines crawler) as well as links of external css, js or other files. So mainly there are 3 type of html elements/tags i.e. opening tags, closing tags and self-closing tags.
Here are some valid list of self-closing tags
<br /><hr /><area /><col /><base /><meta /><embed /><param /><img /><source /><track /><wbr /><input /><link />
What is SGML?
SGML stands for Standard Generalized Markup Language. It is a meta-language which is used to write many markup languages. SGML is a standard for defining the generalised markup language which tells about how to specify the document's description, it is not a document language. SGML is a way to define the markup language and sets the standard for their form. As a parent passes on genetic traits to a child, similarly SGML passes a structure and a format rule to existing markup languages so can say HTML is a child or application of SGML.
Relationship Between HTML and SGML
- HTML is a markup language which is the descendant of SGML (SGML is the forerunner of HTML).
- HTML is the markup language which is based on SGML but has some differences.
Comparison Between HTML and SGML
HTML vs SGML
|HTML is a markup language means the language which is made of tags. It is used to create the webpage of application.||SGML is a standard for defining the generalised markup language which tells about how to specify the document's description.|
|HTML is the markup language which is based on SGML.||An SGML document might be composed of many entities such as discrete pieces of text.|
|HTML Stands for HyperText Markup Language||SGML Stands for Standard Generalized Markup Language.|