7

6 Cool Things You Can Do With Regular HTML

 2 years ago
source link: https://blog.bitsrc.io/super-cool-things-raw-html-can-do-35f2120c4cae
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

6 Cool Things You Can Do With Regular HTML

No fancy libraries, just regular, raw HTML

Photo by Chris Arthur-Collins on Unsplash

It's no wonder that HTML can do some stuff that we might even think that it is an external library. If efficiently used we can even hack NASA (I'm just kidding). So let's look into some cool features of HyperText Markup Language.

1. Color Picker

Create a color picker by simply using the <input> tag and giving it a property of type=’color’.

1*JNdyq2xDOyk_Nsl1gzK5IA.png?q=20
super-cool-things-raw-html-can-do-35f2120c4cae
1*B7XrQ-le9Io1RSSl9DqWoA.png?q=20
super-cool-things-raw-html-can-do-35f2120c4cae

2. Accordion

The <summary> tag defines a visible heading for the <details> element.

The heading can be clicked to view/hide the details.

1*8uWEroR0LDZ-Oh5YzjiYOQ.png?q=20
super-cool-things-raw-html-can-do-35f2120c4cae
1*P6cMCC4Z0hdh3en9ehzmdA.png?q=20
super-cool-things-raw-html-can-do-35f2120c4cae
Before opening
1*zJhWvgiwZsJ3a_MWY7pRTg.png?q=20
super-cool-things-raw-html-can-do-35f2120c4cae
after opening

You can create simple accordions using this method, without the need to implement CSS classes and JavaScript click handlers that toggle visibility whenever clicked.

3. Make a call

Call someone direct from your website.

1*ILThV2rKf3ivSzSzrCQJXg.png?q=20
super-cool-things-raw-html-can-do-35f2120c4cae

4. Progress bar

You can use the <progress> element which will represent the completion of something.

1*pLr4JqzOeMlv2G0lASG19g.png?q=20
super-cool-things-raw-html-can-do-35f2120c4cae
1*h6lB6eNeLl0iI4b_kzRR1Q.png?q=20
super-cool-things-raw-html-can-do-35f2120c4cae

5. Autocomplete

The <datalist> tag is used to provide an “autocomplete” feature for the <input> elements.

1*I6azUJtzzUhc4ZCd9sAc8g.png?q=20
super-cool-things-raw-html-can-do-35f2120c4cae
1*PnlXn5zrwHOq_BVBMM90lQ.png?q=20
super-cool-things-raw-html-can-do-35f2120c4cae
1*sayx9eWA3VsIo-Lg-2A6gg.png?q=20
super-cool-things-raw-html-can-do-35f2120c4cae
1*pd65D_s3R9C7dYofF54KOw.png?q=20
super-cool-things-raw-html-can-do-35f2120c4cae

We can see a drop-down of predefined options as you type.

6. Emoji

Many UTF-8 characters cannot be typed on a keyboard. Some keyboards and devices also do not have an emoji input. However, emojis can always be displayed using numbers (known as ‘entity numbers’).

1*Wh4XIK29K20sPuwzE4q6cg.png?q=20
super-cool-things-raw-html-can-do-35f2120c4cae
1*5K05TaIGqnlzEIL0evhdxQ.png?q=20
super-cool-things-raw-html-can-do-35f2120c4cae

We can use this method to produce emojis in HTML.

Conclusion

Here we discussed a few HTML-only things that might save you time, and avoid the need to complicate things by incorporating CSS and JavaScript.

I hope you have found this useful. Were any of these tips new to you? If so, be sure to let us know in the comments.

Build modular, reusable React components with Bit.

Monorepos are a great way to speed up and scale app development, with independent deployments, decoupled codebases, and autonomous teams.

Bit offers a great developer experience for building component-driven monorepos. Build components, collaborate, and compose applications that scale. Our GitHub has over 14.5k stars!

Give Bit a try →

0*uwEH02y1Xlb0zkVX.png?q=20
super-cool-things-raw-html-can-do-35f2120c4cae
An independently source-controlled and shared “card” component (on the right, its dependency graph, auto-generated by Bit)

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK