DEV Community

Cover image for 20 Days of HTML(Learn 20 amazing things about HTML) Part 1
theindiancodinggirl
theindiancodinggirl

Posted on

20 Days of HTML(Learn 20 amazing things about HTML) Part 1

Day 1- Divide webpage into logical sections

⁣HTML5 offers several elements that will help you organize your layout in appropriate sections:⁣⁣

  1. Header <header>
  2. Navigation bar <nav>
  3. Main Content <main> with <article> and <section> ⁣⁣
  4. Sidebar <aside>⁣⁣
  5. Footer <footer>

⁣⁣Good Webpages may look or perform differently but they share similar standard structure.⁣⁣
⁣⁣
By using this standard structure with the semantic elements mentioned above your document becomes more readable and accessible.⁣⁣

Day 2- What are the Semantic elements? Why are they important?

Rather than writing vague divs in your document.
How about using semantic tags?

Semantic tags define the purpose of the element. It's beneficial to use tags, class names and ids that give meaning to your content rather than just define its looks. Presentation is the responsibility of CSS.

For example- <p>,<header>,<figure> tells the content wrapped around them are paragraph, header or image. They help the browser, as well as developers, understand the meaning of their content.

Why is Semantic HTML important?

  • Helps to write clean and maintainable code
  • Enhances Accessibility
  • Improves SEO

Day 3- Make any content on your page editable by users

The text of the webpage can be made editable using the contenteditable attribute.

Just set the contenteditable to true on any of the elements you want to make editable.
It can be helpful in the making of a simple text editor.

<div contenteditable="true">
  Edit me!
</div>

Day 4- Implement a Download button with HTML5

Usually, when the user clicks on a link to media files, it will be opened in the browser.
If you want to give users the option to save that file on their computer, download attribute can be used.

The download attribute to <a> elements makes the linked URL a download link rather than a navigational. Meaning users can save the link rather than navigating to it.

The download attribute can be used with or without value. To rename the default name, a value can be given which becomes the name of the file.

<a href="this-is-the-download-link.pdf" download="Download.pdf">
  Download me
</a>

Day 5- Define options with datalist tag

⁣The Html5 <datalist> tag is used to provide autocomplete feature in the input field of the form.⁣

It specifies the set of predefined options for the user to input.⁣

To bind it to the input, it is usually used with the <input> element's list attribute whose value matches the datalist id.⁣
⁣It works with all types of inputs like data, range, color etc.⁣

<input list="languages" placeholder="Choose language" />
<datalist id="languages">
  <option>Python</option>
  <option>Javascript</option>
  <option>Java</option>
</datalist>

Day 6- Collapsible Sections with HTML5⁣

⁣Details tag is used to make collapsible sections when it is required to provide extra information about a subject that users can hide or view by their choice.

Used with the summary tag which specifies the title that can be clicked to expand or collapse the details.⁣

By default, the details are hidden, the open attribute can be used to change the default behavior.⁣

<details>
<summary> Javascript </summary>
<p> I am an amazing language </p>
</details>

Day 7- Responsive Images with srcset

⁣To make an image responsive means to switch between different versions of the image so that they are being displayed according to their respective device sizes and resolutions.⁣

⁣srcset, an attribute of <img> element is used to give URLs of different versions of the image and a descriptor so that the browser can display the most appropriate one in a given situation.⁣

Here, descriptor x represents device-pixel-ratio i.e a device with 2x resolution will only display the image associated with 2x in the srcset attribute. ⁣

The src attribute is present for browsers that don't understand srcset.

<img srcset="pizza-small.jpg,
             pizza-medium.jpg 1.5x,
             pizza-large.jpg 2x"
     src="pizza-large.jpg"
     alt="a slice of cheesy pizza">

Day 8- HTML Periodic Tables

⁣There exist periodic tables and cheatsheets for HTML elements. ⁣
⁣A great tool to find all the elements with their descriptions in a single place.⁣
These can be very helpful and handy as who remembers all the tags.

https://htmlcheatsheet.com/
https://developer.mozilla.org/en-US/docs/Learn/HTML/Cheatsheet
https://websitesetup.org/html5-periodical-table/

Day 9- All about Quotations

⁣Quotations are an important part of the content.⁣
There are few elements that can be used according to their semantic meanings to display quotations on your page:

The <blockquote> element:

  • Provides a section that defines quotations from another source.⁣
  • Used for indicating long quotations.⁣
  • Cite attribute is used to provide the URL of the source of the quotation.⁣

The <q> element:

  • Provides an inline quote in a block of text. ⁣
  • Used for indicating short quotations.⁣
  • Inserts quotation marks around the enclosed text.⁣

The <cite> element:

  • Provides the title of the source of work(e.g. book, album, song, poem, essay, etc.)⁣
<blockquote>
  The future was uncertain, absolutely, and there were many hurdles, twists, and turns to come, but as long as I kept moving forward, one foot in front of the other, the voices of fear and shame, the messages from those who wanted me to believe that I wasn't good enough, would be stilled.
  ― Chris Gardner,
  <cite>The Pursuit of Happyness</cite>
</blockquote>
<p>
  <q>The goal isn't to live forever, the goal is to create something that will.</q><br>
  ― Chuck Palahniuk, <cite>Diary</cite>
</p>

Day 10- Highlight it!

⁣Ever wanted to have highlighted text on your page?⁣
You can do it with just HTML, use <mark> tag to highlight parts of the text which needs extra attention.⁣

Mostly used with quotations which are from other sources to determine which text is more relevant according to you. ⁣

Don't use it only for decoration purpose.⁣

Difference between <mark> and <strong>-
<mark> denotes relevance of the content, while <strong> indicates importance.

<p>
  <q>The goal isn't to live forever, the goal is to <mark>create something</mark> that will.
  </q><br />
  ― Chuck Palahniuk, <cite>Diary</cite>
</p>


Thanks for reading ❤

Twitter
Instagram

Top comments (23)

Collapse
 
molecula451 profile image
Paul • Edited

What I like of this guide is that show you not matter how much a technology simple could be (Some people thoughts about HTML). There'll be always something new to learn at the end of the day on the technology field. Great work!

Collapse
 
vmuthabuku profile image
vincent muthabuku

Nice one, Keep up

Collapse
 
theindiancodinggrl profile image
theindiancodinggirl

Thanks 😊

Collapse
 
judecodes profile image
Cool

This is so amazing lmao there was still lots of tags I've still not know

Collapse
 
theindiancodinggrl profile image
theindiancodinggirl

Yes, there is always lot to learn😊

Collapse
 
electronlab profile image
Harsh Vardhan Goswami

I loved this post and it was so good for all the newbies out there😊You did an awesome work

Collapse
 
theindiancodinggrl profile image
theindiancodinggirl

Thanks 😊

Collapse
 
garrettnoble profile image
Garrett Noble

This is an amazing resource for all! Thank you for sharing!

Collapse
 
theindiancodinggrl profile image
theindiancodinggirl

Glad you like it😊

Collapse
 
khatrimanoj profile image
manoj khatri

i m working as a front end developer since 4 years. but today i learnt something new about html tags. may be i just writing a code never thought about its usage and value. thanks for such a great post

Collapse
 
mensdarko profile image
Darko Mens

Thanks for sharing

Collapse
 
theindiancodinggrl profile image
theindiancodinggirl

😊

Collapse
 
de_heuer profile image
dominic.ryuhei

i'm most enlightened! giga thanks!

Collapse
 
theindiancodinggrl profile image
theindiancodinggirl

😊😊

Collapse
 
theindiancodinggrl profile image
theindiancodinggirl

Glad You liked it😊

Collapse
 
vaibhavkhulbe profile image
Vaibhav Khulbe

Great post! Keep writing 🔥

Collapse
 
theindiancodinggrl profile image
theindiancodinggirl

Thanks😊