Awesome list. A lot of lists like this include elements that are obsolete or of limited and specific use. These are all great.
Two little additions.
In terms of accessibility it is important to note that you shouldn’t add alt text for an image just to have it there. If the image is meaningful to the information being presented then yes it’s necessary. However, if the image is purely decorative then you should have an empty alt attribute. This will mark the image as presentational and it will be ignored by screen readers.
In the example use case you use for the title attribute you could also use the abbr element which indicates that the contents of the element are an abbreviation. The title attribute then provides the full expansion of the term.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
Ethical open source and web accessibility evangelist, front-end engineer, destigmatizing mental illness, podcaster, writer, and speaker. I want to make a meaningful impact no matter how small.
Thank you for writing this great article! I wanted to call out two caveats concerning the base element:
<basehref="https://shefali.dev"target="_blank"/>
It is important to be aware that the above will impact all other elements on the page which has either an href or target attribute. Therefore, the following will try to load the CSS file from the base domain:
Also, if you have a form element with a target attribute, it will be affected by the target on the base element as well. Concerning the first example where it will impact the link element. The base element only impacts elements that come after it in source order so the following will avoid the problem:
Ethical open source and web accessibility evangelist, front-end engineer, destigmatizing mental illness, podcaster, writer, and speaker. I want to make a meaningful impact no matter how small.
It means that all other elements that come after the above in the HTML document and have a href attribute with a relative URL will be affected by the above. For example, let's say you are including a stylesheet as follows:
This might be exactly what you wanted, but it might also not be. To avoid impacting the link element you would need to ensure that the link element is before the base element in the HTML Source order so:
If you have an anchor element the same thing will apply:
<ahref="/portfolio.html">View my portfolio</a>
This will become:
<ahref="https://shefali.dev/portfolio.html">View my portfolio</a>
Again this might be totally fine. The other thing is the target attribute will also impact the above so all anchor links on the page will open in a new tab/window. But also, any form on the page will also be impacted. In other words:
Things can also get trickier when you consider the complete URL parsing algorithm that is used. You can read more about that here: schalkneethling.github.io/html-com...
I hope this helps, but should you have any more questions, let me know. Happy coding!
Ethical open source and web accessibility evangelist, front-end engineer, destigmatizing mental illness, podcaster, writer, and speaker. I want to make a meaningful impact no matter how small.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
Good list, I had never heard of the <base> element before so I did some research. You should definitely understand the need for and effect of using the <base> element on your site before you add it. I found this StackOverflow question helpful here.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
One tip for download link. We can specify a different name of the file to download instead on its actual name using the download attribute as following:
<ahref="document.pdf"download="My Document.pdf"> Download PDF </a>
With the above code, the linked PDF file will be saved as "My Document.pdf" by default instead of "document.pdf".
And, to correct your tip, we just need to write the download attribute without the value to allow downloading the file. So the following is valid to allow download of the file without changing the file name:
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
Warning for accessibility, not every single image need an alternative, because some are purely decorative, not transmitting any kind of useful information for the user.
For decorative image, "alt" attribute need to be there, but be left empty.
If you put a non-empty "alt" attribute on a decorative image, you have to hide it to assistive technologies with an aria-hidden="true" attribute.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
Name is Gad Iradufasha,
Web developer and System Analyst/Designer
Skills In web development are:
SEO ( Search Engine Optimization),
Building Websites & Web apps.
Visual artist.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
Thank you for sharing the 21 HTML tips Your insights have provided valuable guidance and inspiration for enhancing our HTML skills. Your willingness to share knowledge is greatly appreciated, and we're excited to implement these tips in our coding journey. Here's to continuous learning and growth in the world of web development.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
This article would be useful if it had live examples rather than just posting code. If I want to see any of these in action I have to create my own code.. and if I don't have the images it becomes a lot of work. Missed opportunity here. I stopped reading at the 5th one.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
Farouk, IT expert with 20+ years, excels in networking, user support, and strategic planning. Adept in VMs, IAM, and MS Office. Driving GCMX's global success. Currently mastering Drupal CMS.
Location
Kano, Nigeria
Education
Bayeo University Kano (Bsc Maths), Intellipaat (PG cloud and DevOps), Simplilearn (AWS CCP)
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
Farouk, IT expert with 20+ years, excels in networking, user support, and strategic planning. Adept in VMs, IAM, and MS Office. Driving GCMX's global success. Currently mastering Drupal CMS.
Location
Kano, Nigeria
Education
Bayeo University Kano (Bsc Maths), Intellipaat (PG cloud and DevOps), Simplilearn (AWS CCP)
Hi Shefali I have read about your profile and am very impressive, I am new to software development and I really wanna switch from IT Networking and Help Desk Support to Development, currently I am learning Drupal CMS and like I need to master HTML, CSS, PHP but I somehow get stuck along the way, is there any suggestion or guidance I can get from you?
Thanks
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
Professional Data Engineer/Business Intelligence Developer. I build build and test various data pipelines between production and analytics databases. Additionally, I design dashboards.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
Open-Source Enthusiast | MERN Stack | Content Creator
Create content on
- JavaScript
- Open Source
- Web Dev
- Public Speaking
Always interested for collaboration, engagement:)
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
The code is written on the tablet of ours hearts by God Himself. Blessings!..
Todo lo podemos en Cristo Jesús que nos da la fuerza y fortaleza para seguir avanzando hacia adelante :3 - Filipenses 4:13
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
I am a passionate web developer from India. I find pleasure in talking about programming and I love to help everyone who needs any guidance related to programming.
Iam a school student . I have very interested in web devlopment. so, I am learning html, css and js.I amlearning frontend devlopment now i will shift frontend to backend.
hello, madam I am fan of your I need help to learning web developments backend can you help me can you contact me . I am a student of school .I need immediately help of your I think you can help me and will help. Thanks
Awesome list. A lot of lists like this include elements that are obsolete or of limited and specific use. These are all great.
Two little additions.
In terms of accessibility it is important to note that you shouldn’t add
alttext for an image just to have it there. If the image is meaningful to the information being presented then yes it’s necessary. However, if the image is purely decorative then you should have an emptyaltattribute. This will mark the image as presentational and it will be ignored by screen readers.In the example use case you use for the title attribute you could also use the
abbrelement which indicates that the contents of the element are an abbreviation. Thetitleattribute then provides the full expansion of the term.Thank you so much for your feedback, Luke!
I appreciate it:)
Thank you for writing this great article! I wanted to call out two caveats concerning the
baseelement:It is important to be aware that the above will impact all other elements on the page which has either an
hrefortargetattribute. Therefore, the following will try to load the CSS file from the base domain:Also, if you have a
formelement with atargetattribute, it will be affected by thetargeton thebaseelement as well. Concerning the first example where it will impact thelinkelement. Thebaseelement only impacts elements that come after it in source order so the following will avoid the problem:hey there, I couldn't quite understand what you tried to say here. Can you explain what you have to do to avoid the problem?
Hey! So when you have the following in the head of your HTML document:
It means that all other elements that come after the above in the HTML document and have a
hrefattribute with a relative URL will be affected by the above. For example, let's say you are including a stylesheet as follows:What the browser will do is add the base
hrefto the above:This might be exactly what you wanted, but it might also not be. To avoid impacting the
linkelement you would need to ensure that thelinkelement is before thebaseelement in the HTML Source order so:And not:
If you have an anchor element the same thing will apply:
This will become:
Again this might be totally fine. The other thing is the
targetattribute will also impact the above so all anchor links on the page will open in a new tab/window. But also, any form on the page will also be impacted. In other words:Will become:
Things can also get trickier when you consider the complete URL parsing algorithm that is used. You can read more about that here: schalkneethling.github.io/html-com...
I hope this helps, but should you have any more questions, let me know. Happy coding!
okay nice. I get it now. Thanks for making it clear.
You are very welcome.
Thank you so much for mentioning. I appreciate it 🙌
Good list, I had never heard of the
<base>element before so I did some research. You should definitely understand the need for and effect of using the<base>element on your site before you add it. I found this StackOverflow question helpful here.Thanks a lot for your feedback!
Yes, definitely. Doing research and understanding the practicality and use cases is mandatory.
One tip for download link. We can specify a different name of the file to download instead on its actual name using the
downloadattribute as following:With the above code, the linked PDF file will be saved as "My Document.pdf" by default instead of "document.pdf".
And, to correct your tip, we just need to write the
downloadattribute without the value to allow downloading the file. So the following is valid to allow download of the file without changing the file name:Thanks for mentioning. I appreciate it:)
Warning for accessibility, not every single image need an alternative, because some are purely decorative, not transmitting any kind of useful information for the user.
For decorative image, "alt" attribute need to be there, but be left empty.
If you put a non-empty "alt" attribute on a decorative image, you have to hide it to assistive technologies with an aria-hidden="true" attribute.
Thanks for your feedback!
Awesome tips collection. Thank you for sharing them in this easy to understand format
Thank you so much for checking out, Lucian!
Thanks for sharing essential information like this.
This is for those people who still don't keep the web accessibility concept in mind when they are designing their web pages using HTML5!
Thank you again!
I am not broke at the moment, I could be buying you a cup of coffee!
Thank you so much for that.
I really appreciate it:)
I'm glad you liked it:)
Thanks for sharing about DevSamples.
WOW! Thank you so much for this! This is immensely helpful! 🔥
I'm really happy you found it helpful. Thanks for checking out, Anita!
Another addition - for abbreviations the element can be used like:
<abbr title="World Health Organization">WHO</abbr>Thanks for adding. I appreciate it:)
Thanks you
My pleasure :)
damn man , nice and sweet article.
Thank you so much!
Thank you for sharing the 21 HTML tips Your insights have provided valuable guidance and inspiration for enhancing our HTML skills. Your willingness to share knowledge is greatly appreciated, and we're excited to implement these tips in our coding journey. Here's to continuous learning and growth in the world of web development.
Thank you so much for checking out!
This article would be useful if it had live examples rather than just posting code. If I want to see any of these in action I have to create my own code.. and if I don't have the images it becomes a lot of work. Missed opportunity here. I stopped reading at the 5th one.
So sorry to hear that. Thanks for your feedback!
I'll keep that in mind.
Very informative, thanks for sharing.
Thanks for checking out:)
Hi Shefali I have read about your profile and am very impressive, I am new to software development and I really wanna switch from IT Networking and Help Desk Support to Development, currently I am learning Drupal CMS and like I need to master HTML, CSS, PHP but I somehow get stuck along the way, is there any suggestion or guidance I can get from you?
Thanks
Nice article, thanks.
I'm glad you liked it:)
Interesting collections!!
Thanks for checking out 🙌
Thanks for the great post!!!!
Thanks for checking out 🙌🏻
Amazing tips
Thanks for your feedback!
This is awesome and very helpful...
Discover some new elements in HTML for the first time, but for the editing by the user, after edit it will not affect the one in the codebase
I'm glad you found something new here.
Thanks for your feedback!
I like it thanks
I'm happy you liked it!
Great collection Shefali 🙌
Thank you!
Thanks for checking out, Akash!
Awesome collection
Thanks for checking out!
i was preparing for interview .it helped me a lot
I'm really glad you found it helpful. Thanks for checking out!
A great list of:
:-)
Thanks for checking out, Mark!
Nice tips, thanks for sharing
I'm glad you liked it. Thanks for checking out 🙌
Thanks dear dev 💛
My pleasure:)
Hi Shefali,
Top, thanks for sharing.
Thanks for checking out😊
great tips,
Thanks for your feedback!
Wonderful collection. Thanks for sharing
I'm glad you liked it:)
"Thank you for the excellent post!"
My pleasure!
great
Thanks a lot:)
15 years in web development and still didn't know some of these utilities. Thanks :)
I'm glad you learned something new here. Thanks for checking out:)
Wow, these tips are so useful, Shefali!!
Thank you so much for sharing quality content <3
Thanks a lot for checking out, Madhu!
Very useful article @devshefali
I'm glad you found it useful. Thanks for checking out!
Thanks for the article, now I'm super strong in writing html😄
Glad to know that😁
Great html tutorial
Thanks for checking out!
Impressive 🤯
Thank you so much!
Wow!.. Alucinante o Gracias pretty!! Por los tip.. Bleessings!!
Aprendiendo de todos un poquito más!.. May GOD always bless you it all..
Thank you so much 🙏
Thanks for sharing!
Thanks for checking out!
Thanks for sharing. The use of semantic HTML must be promoted in every modern day web development. It also paves way for assistive technologies.
Thanks for your feedback :)
Thank you for your amazing efforts it means a lot for beginners.
I'm really happy to hear that. Thank you so much!
hello, madam I am fan of your I need help to learning web developments backend can you help me can you contact me . I am a student of school .I need immediately help of your I think you can help me and will help. Thanks
is base necessary as b default the base url will be the site domain?
great tips tho