MarkDown and HTML Comparison
Markdown is gaining more popularity compare to HTML to style and format your content in text editors, blogs, and social media. Why so?
Markdown is easier to write than HTML, and it’s easier for most humans to read and write Markdown than HTML. Writing HTML by hand is more painstaking and laborious due to its semantic tags for each element.
Here is a comparison to show how you can write Markdown vs HTML to style and format your content:-
Markdown vs HTML
Element | Markdown | HTML | Output | ||||||
---|---|---|---|---|---|---|---|---|---|
Headings |
# Heading 1 ## Heading 2 ### Heading 3 #### Heading 4 ##### Heading 5 ###### Heading 6 |
<h1>Heading 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> <h6>Heading 6</h6> |
Heading 1Heading 2Heading 2Heading 2Heading 2Heading 2 |
||||||
Paragraphs |
This is a paragraph |
<p>This is a paragraph</p> |
This is a paragraph |
||||||
Ordered List |
1. First Item 2. Second Item 3. Third Item |
<ol> <li>First Item</li> <li>Second Item</li> <li>Third Item</li> </ol> |
|
||||||
Unordered List |
- First Item - Second Item - Third Item |
<ul> <li>First Item</li> <li>Second Item</li> <li>Third Item</li> </ul> |
|
||||||
Definition List |
First Term : Definition of first term. |
<dl> <dt>First Term</dt> <dd>Definition of first term.</dd> <dt>Second Term</dt> <dd>Definition of second term.</dd> <dd>Another definition.</dd> </dl> |
|
||||||
Blockquotes | > This is a quote |
<blockquote>This is a quote</blockquote> |
This is a quote |
||||||
Code Blocks |
› › › › function test() { › › › › › › console.log("markdown"); › › › › } |
<pre><code> function test() { console.log("markdown"); } </code></pre> |
|
||||||
Horizontal Rule | --- |
<hr/> |
|||||||
Table |
Header 1 | Header 2 ----------|---------- Cell 11 | Cell 12 Cell 21 | Cell 22 |
<table> <thead> <tr> <th>Header 1</th> <th>Header 2</th> </tr> </thead> <tbody> <tr> <td>Cell 11</td> <td>Cell 12</td> </tr> <tr> <td>Cell 21</td> <td>Cell 22</td> </tr> </tbody> </table> |
|
||||||
Bold | I am **bold** |
I am <b>bold</b> |
I am bold | ||||||
Italic | I am *italic* |
I am <i>italic</i> |
I am italic | ||||||
Strikethrough | I am ~~strike~~ |
I am <del>strike</del> |
I am |
||||||
Link |
[example link](http://example.com/)
|
<a href="http://example.com/"> example link </a> |
example link | ||||||
Image |
![Blog](/img/logo.png)
|
<img src="/img/logo.png" alt="Blog">
|
|||||||
Code | execute command `nano` | execute command <code>nano</code> | execute command nano |