Use data attributes instead of HTML classes to represent state
Learn how to use data attributes to represent UI state and level up your HTML and CSS game.
The HTML snippet collection contains tips, tricks and practical code examples to help you master web development. This collection covers elements, tags, links, forms, tables and more.
Learn how to use data attributes to represent UI state and level up your HTML and CSS game.
Make your HTML documents more SEO-friendly by including these lines in your <head>
element.
Accessibility (a11y) can improve your website and attract new users. Learn how to get started with these 8 quick tips.
Ensure your HTML documents are properly structured by including these lines in your <head>
element.
Preloading content is one of many ways to improve your website's performance.
Keyboard input on mobile devices is hard to get right. Here's how to ensure the right keyboard is displayed for each input.
Understanding how to correctly load your JavaScript files can significantly improve your web application's performance.
Resource prefetching is a great way to improve perceived page speed on your website and requires little effort. Learn how to use it today.
Discover how to improve your website's performance by implementing lazy loading for images using a native HTML attribute.
Ensure your HTML documents have a proper favicon by including these lines in your <head>
element.
Did you know you can customize the starting number of your ordered lists? Learn how with this quick tip.
Learn the difference between the alt
and title
attributes on images in HTML.
Opening a link in a new tab comes with a security vulnerability that you may not be aware of. Protect your users with this simple trick.
Learn what HTML5 attribute you can use to customize the names of your downloadable files with this quick tip.
Number-only inputs aren't as straightforward as you might expect. Here's a user-friendly way to set them up.
Ensure your HTML documents can be shared on social media by including these lines in your <head>
element.
Using an HTML element, you can easily make all links in your document open in a new tab. Learn how with this quick tip.
Learn how to correctly use the alt
attribute on images in HTML.
Did you know there's an easy way to create a descending list of numbered items with pure HTML? Learn how with this handy tip.
Use the HTML autocomplete
attribute to create more secure and accessible password fields.