Why <!DOCTYPE html>?

➊ History

✧ In the old days of the web, pages were written in two versions: One for Netscape Navigator, and one for Microsoft IE.

✧ When the web standards were made at W3C, browsers could not just start using them, as doing so would break most existing sites on the web.
✧ Browsers therefore introduced two modes to treat new standards compliant sites differently from old legacy sites.

✧ Modes were: Quirks Mode and Standards Mode.

✧ For HTML documents, browsers use a DOCTYPE in the beginning of the document to decide which mode to handle.
➋ Doctype

✧ In HTML, the doctype is "required" to ensure that the browser makes a best-effort attempt at following the relevant specifications.

✧ Doctype is "not" an HTML element, rather a special instruction to the browser.
✧ If specified, it has to be at "the beginning" of the HTML document just after the Byte-Order-Mark (BOM) if any.

✧ The DOCTYPE for HTML5 is case-insensitive and can be written as

< !DOCTYPE html >
➌ Formats of Doctypes

There are 3 types

⮑ Normal
⮑ Deprecated
⮑ Legacy Tool Compatible
➍ Examples

⮑ Normal (HTML5)
<!DOCTYPE html>

⮑ Deprecated (HTML 4/4.01, XHTML 1.0/1.1)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

⮑ Legacy Tool Compatible
<!DOCTYPE html system "about:legacy-compat">
➎ If Doctype is not specified?

❑ Browser will switch into "Quirks Mode" when rendering a document.

❒ Quirks Mode "may be" incompatible with some standard specifications.

❑ The document may "render differently" in different browsers.
➏ Let's summarise

✧ "<!DOCTYPE html>" is the required preamble found at the top of all HTML documents.

✧ Its sole purpose is to prevent a browser from switching into “Quirks Mode” when rendering a document.
⚠️ Repost Notice ⚠️

⬘ Though this is my original work, portions of it was previously posted in [CHIRPBIRDICON]

⬙ If you liked this content and do feel others might learn from it, please support.
💭 Feedbacks

✧ Did you find this thread useful?
✧ After reading through entire thread, have you learnt something worth?
✧ What improvements will you suggest?

Hey 👋. I will be happy to hear from you. Your feedbacks would help me sharing better contents in future.
End of 🧵

Hey 👋 I am a Tech Educator from India 🇮🇳

I am sharing Tutorials, Tips, Techniques, Infographics, Cheat Sheets, Interview Questions and Roadmaps on Web Development, DSA and, Database.

Are you interested? I am sure, you are.

To never miss anything, Follow Me ✅

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Swapna Kumar Panda 

Swapna Kumar Panda  Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @swapnakpanda

Mar 16
60+ Shorthand Properties : CSS Cheat Sheet

Image
🌆 Direct Link for High Resolution Image

If you liked this one, give a ⭐️ to this GitHub repo to support my work.

✧ Direct Link:
github.com/swapnakpanda/I…
Read 10 tweets
Mar 14
🛣 Beginner's Roadmap for Front-End

HTML & CSS → 👩‍💻 → JavaScript → 👩‍💻

👩‍💻 ← React* ← 👩‍💻 ← Tailwind*

TypeScript → 👩‍💻 → Next.js* → 👩‍💻 → 🏁

💭 Why is this thread?

❑ Beginners willing to start their Front-End journey are often get confused about what all they have to learn and explore.

❒ This is my honest attempt to help them by sharing a clear roadmap.

❑ It is from my 15 years of Web Development experience.
📋 Table of Contents

➊ HTML & CSS
➋ JavaScript
➌ CSS Frameworks
➍ UI Frameworks
➎ TypeScript
➏ Server-side Frameworks
➐ Others
➑ What is essential?
Read 17 tweets
Mar 13
25 super useful methods in JavaScript

💭 Why this thread?

❑ If you have just started learning JavaScript, you might have felt exhausted by seeing so many methods.

❒ If you are simply going through those methods without knowing their use cases, it's going to be tough for you later.

❑ Let's learn use cases.
📋 Table of Contents

❑ Array.prototype's

➊ forEach()
➋ map()
➌ reduce()
➍ every()
➎ filter()
➏ find()
➐ slice()
➑ splice()
➒ push()
➓ pop()
➊➊ shift()
➊➋ unshift()
➊➌ indexOf()
➊➍ findIndex()
➊➎ sort()
Read 25 tweets
Mar 12
💎 JavaScript Cheat Sheet : Math Object

Find Complete Reference of
❍ 8 Constants
❍ 35 Functions

✧ Link to High Resolution image in the next tweet JavaScript Math Object  1. Constants  a. Math.E  b. Math.LN2
🏙 High Resolution Image

⬒ If you liked this one, give a ⭐️ to this GitHub repo to support my work.

⬓ Direct Link:
github.com/swapnakpanda/I…
🚥 Disclaimer

⬔ I have compiled these information with all sincerity. But in case you find any omissions or, wrong representations, 💬 me.

⬕ Share your feedbacks if you see any area of improvement for me. Feedbacks are highly appreciated.
Read 4 tweets
Mar 11
Let's redefine the "undefined". Can we do it in JavaScript?

➊ What is "undefined"?

❑ "undefined" is a variable in the global scope. The value of "undefined" is the primitive value "undefined"

❒ When a variable is declared but not assigned any value, value of global variable "undefined" is assigned to it implicitly.
➋ "undefined" is not a reserved keyword

❑ It means you can declare a variable named "undefined".

❒ So, what will happen if you declare a variable called "undefined" and assign some other value to it?

Let's explore.
Read 7 tweets
Mar 10
🟦 All inline & block-level elements in HTML / CSS

Check inside the 🧵 for

✧ Interesting details about inline & block-level
✧ Link to high resolution image

HTML elements can be categorized as either "block-level
📋 Table of Contents

➊ Introduction
➋ inline-level
➌ block-level
➍ Changing Element Level
➎ List of inline-level elements
➏ List of block-level elements
➐ Link to High Resolution Image
🚥 Disclaimer

❑ I have compiled these information with all sincerity. But in case you find any omissions or, wrong representations, 💬 me.

❒ If you have any suggestions or, feedbacks, share those with me. I am eager to hear from you.
Read 18 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(