HTML tips - hidden gems.

🧡
1. The `loading=lazy` attribute

You can use the `loading=lazy` attribute to defer the loading of the image until the user scrolls to them. <img src='image.jpg' loading='lazy' alt='Alternative Text'>
2. Email, call, and SMS links: <a href="mailto:{email}?subject={subject}&body={content
3. Ordered lists `start` attribute.

Use the `start` attribute to change the starting point for your ordered lists. Code:  <ol start="11">   <li>HTML</li>   <li>CSS</
4. The `meter` element

You can use the `<meter>` element to display quantities. No JavaScript/CSS needed. <label for="value1">Low</label> <meter id="va
5. `window.opener`

Pages opened with `target="_blank"` allow the new page to access the original’s `window.opener`. This can have security and performance implications. Include `rel="noopener"` or `rel="noreferrer"` to prevent this.  <a href="https://markodenic.com/" target="_b
6. Base Element

If you want to open all links in the document in a new tab, you can use <base> element: <head>   <base target="_blank"> </head> ... <!-- T
7. Favicon cache busting

To refresh your website’s favicon you can force browsers to download a new version by adding ?v=2 to the filename.

This is especially helpful in production to make sure the users get the new version. <link rel="icon" href="/favicon.ico?v=2"
8. Native HTML sliders

You can use `<input type="range">` to create sliders. <label for="volume">Volume: </label> <input type=&
9. HTML Accordion

You can use the `details` element to create a native HTML accordion. <details>   <summary>     Click me to see more details   </s
10. `mark` tag

You can use the `<mark>` tag to highlight text. <p>Don't forget to be <mark>awesome</mark> today.</p>
11. `download` attribute

You can use the `download` attribute in your links to download the file instead of navigating to it. <a href='path/to/file' download>   Download </a>
12. Performance tip

Use the `.webp` image format to make images smaller and boost the performance of your website. <picture>   <!-- load .webp image if supported -->   <source
If you liked this thread, maybe you'd love to bookmark it as a post.

P.S. You can find a few more tips there.

markodenic.com/html-tips/
If you're learning HTML, CSS or JavaScript be sure to follow me and never miss tips like this.

β€’ β€’ β€’

Missing some Tweet in this thread? You can try to force a refresh
γ€€

Keep Current with Marko ⚑ Denic

Marko ⚑ Denic Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @denicmarko

2 Apr
CSS tips you won't see in most tutorials.

🧡
1. Smooth scrolling

Smooth scrolling with zero JavaScript, with just one line of CSS. html {   scroll-behavior: smooth; }
2. When you work with transparent images you can use the `drop-shadow()` filter function to create a shadow on the image's content, instead of `box-shadow` property which creates a rectangular shadow behind an element's entire box:

filter: drop-shadow(2px 4px 8px #585858); Two images shown. One with rectangular shadow around whole i
Read 15 tweets
29 Mar
Are you're learning JavaScript?

I'm sure you've heard a million times to learn the fundamentals first.

But what are they? And where to learn them?

I made a list of JavaScript fundamentals and free resources for learning them.

🧡
2. Data Types

Understanding data types, by @lisaironcutter.

digitalocean.com/community/tuto…
Read 11 tweets
28 Mar
Websites to find a remote job:

πŸ“Œ flexjobs. com
πŸ“Œ remote. co
πŸ“Œ justremote. co
πŸ“Œ weworkremotely. com
πŸ“Œ remoteok. io
πŸ“Œ jobspresso. co
πŸ“Œ europeremotely. com
πŸ“Œ wfh. io
πŸ“Œ dailyremote. com
πŸ“Œ angel. co
πŸ“Œ jsremotely. com
πŸ“Œ remoteleaf. com
πŸ“Œ remoteleads. io
πŸ“Œ hired. com
It looks like @gitlab has a lot of open positions.

Read 5 tweets
24 Mar
Websites to find code snippets.

🧡
1. CSS Tricks Snippets

~ HTML
~ CSS
~ Sass
~ SVG
~ htaccess
~ JavaScript
~ jQuery
~ WordPress
~ PHP

Link: css-tricks.com/snippets/
2. 30 Seconds Of Code

~ JavaScript
~ CSS
~ Python
~ React

Link: 30secondsofcode.org
Read 6 tweets
22 Mar
You can use CSS generators to avoid some time-consuming, routine tasks.

I made a collection of the best CSS generators for you.

🧡
1. Neumorphism/Soft UI generator

CSS code generator that will help with colors, gradients, and shadows to adopt this new design trend or discover its possibilities.

Link: neumorphism.io
2. Smooth Shadow generator

Built by @funkensturm.

Link: shadows.brumm.af
Read 11 tweets
20 Mar
Do you want to stand out in a job interview? Learn Git.

Git is an essential tool for developers. Every team is using some kind of version control system and Git is the most commonly used.

I collected for you a few tools to help you learn Git.

🧡
1. Git and Git-flow cheat sheet.

Link: github.com/arslanbilal/gi… The link preview.
2. Learn Git branching

An interactive Git visualization tool to educate and challenge!

Link: learngitbranching.js.org Screenshot of the provided link.
Read 6 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!