Member-only story
Here are 11 HTML tips you should be aware of
I wanted to take a moment to share some valuable HTML tips that can significantly simplify your life as a developer. Let’s get to it.
Creating download links in HTML
The download
attribute in the <a>
tag allows you to specify when users click the link, the linked resource should be downloaded instead of opening in the browser.
<a href="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSFGvfXnNyB1HacT6EgBLYkRwBXnPa9GSYd_zjyWtDbzw&s" download="document.pdf"> Download PDF </a>
Group your dropdown menus in HMTL
This is useful and it enhances your website’s UX if you have too many options
<select name="cars" id="cars">
<optgroup label="Swedish Cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</optgroup>
</select>
Collapsible content in HTML
You can save some space with a collapsible section on your site without the need for CSS.