Powerful CSS Tricks You May Not Know

Some complex interactions that can be achieved with just CSS

Introduction

Nowadays, a variety of front-end framework is prevalent in the era, simply completing some of the interface features have become more and more convenient.

However, too much use of these frameworks without more research to think about the specific implementation of such frameworks, just will not be able to quickly improve their ability, on the contrary, with more sometimes will obscure their vision, unable to complete their knowledge system upgrade.

Today, I’m going to talk about CSS can do some functional interaction, these functions may be the first time you thought of before may be to use JS, and I do not know if the powerful CSS can also be completed, I hope that through my sharing can increase your knowledge of vision.

Let’s begin.

1. Tabs

A single content area with multiple panels, each associated with a header in a list.

Key points

  1. Only one radio group with the same name property can be selected at a time to simulate panel switching.
  2. Use radio with the focusable property to simulate a click event.
  3. Use CSS derived selector, combined with a z-index hierarchy to complete the content of the visible and hidden switch.

2. Collapse

Key points

  1. Use the checkbox multi-selection property to simulate simultaneous event focus.
  2. Use a checkbox with focusable property to simulate a click event.
  3. Use CSS derived selector to transform the height of the content to complete the face collapse effect.

3. Dialog

Open content in an interactive overlay.

Key points

  1. Position the element by a tag aiming point, href and id are consistent, simulate the click.
  2. Position the modal element by the : target selector, toggle the display and hide.

4. LightBox

Key points

  1. Position the element through the tag aiming point, href and id are consistent, simulating a click
  2. Position the element through the :target selector to display a larger image

5. Tooltip

Customizable, themeable tooltips, replacing native tooltips.

Key points

  1. Use the HTML custom attribute data-attr to store the hint content
  2. Use attr(data-attr) to get the hint content and use hover to display the text hint

6. Indicator

Key points

  1. Set the background of the Body element to gradient
  2. Cover the body with a white background mask layer to reveal a little bit of the top to show the progress

Conclusion

After reading the above examples, I hope you now have a deeper understanding of the power of CSS. Please share some of your CSS special useful tips in the comments, so we can learn together.

Code Links

Build composable web applications

Don’t build web monoliths. Use Bit to create and compose decoupled software components — in your favourite frameworks like React or Node. Build scalable and modular applications with a powerful and enjoyable dev experience.

Bring your team to Bit Cloud to host and collaborate on components together, and speed up, scale, and standardize development as a team. Try composable frontends with a Design System or Micro Frontends, or explore the composable backend with serverside components.

Give it a try →

Learn more


Powerful CSS Tricks You May Not Know was originally published in Bits and Pieces on Medium, where people are continuing the conversation by highlighting and responding to this story.

Leave a Reply

Your email address will not be published. Required fields are marked *

Instagram

Why do People Say: "Developers are Lazy"?
The saying “work smart, not hard” is applicable for programmers.
.
https://hackernoon.com/why-do-people-say-developers-are-lazy

.
Author: Aga Wozniak
.
.
.
.
.
#blog #100Daysofcode #javascript #vuejs #datascientist #peoplewhocode #learntocode #coding #developerlife #frontenddeveloper #backenddeveloper #fullstackdeveloper #developer #webdeveloper #thedevlife #phpdeveloper #computerscience #programmer #programmingisfun #codingdays
...

Mitigating the DDOS Threats Facing Banks and Fintechs
As much as digitization and cyber simplified banking, the Fintech sector has left digital payment activity exposed to malicious and suspicious activity.
.
https://hackernoon.com/mitigating-the-ddos-threats-facing-banks-and-fintechs

.
Author: Josh Horowitz
.
.
.
.
.
#blog #100Daysofcode #javascript #vuejs #datascientist #peoplewhocode #learntocode #coding #developerlife #frontenddeveloper #backenddeveloper #fullstackdeveloper #developer #webdeveloper #thedevlife #phpdeveloper #computerscience #programmer #programmingisfun #codingdays
...

24 Best JavaScript Blogs and Websites
In this overview, we have compiled a list of popular sites, as well as JS blogs that are worth reading and keeping in your bookmarks.
.
https://hackernoon.com/24-best-javascript-blogs-and-websites

.
Author: natashatsybliyenko
.
.
.
.
.
#blog #100Daysofcode #javascript #vuejs #datascientist #peoplewhocode #learntocode #coding #developerlife #frontenddeveloper #backenddeveloper #fullstackdeveloper #developer #webdeveloper #thedevlife #phpdeveloper #computerscience #programmer #programmingisfun #codingdays
...

The Projects Working to Lower Ethereum Gas Fees
As more investors try their hand at DeFi, gas fees are shooting over the roof, making engaging with decentralized apps uneconomical for most users.
.
https://hackernoon.com/ethereum-gas-fees-are-there-any-projects-working-to-optimize-eth-gas-fees

.
Author: CryptoVirally SLR
.
.
.
.
.
#blog #100Daysofcode #javascript #vuejs #datascientist #peoplewhocode #learntocode #coding #developerlife #frontenddeveloper #backenddeveloper #fullstackdeveloper #developer #webdeveloper #thedevlife #phpdeveloper #computerscience #programmer #programmingisfun #codingdays
...

On the Edge of a New Year: IT Predictions for 2022
The single biggest cause of network errors are people.
.
https://hackernoon.com/an-interview-with-uplogix-ceo-lisa-frankovitch

.
Author: Mignonette Garnier
.
.
.
.
.
#blog #100Daysofcode #javascript #vuejs #datascientist #peoplewhocode #learntocode #coding #developerlife #frontenddeveloper #backenddeveloper #fullstackdeveloper #developer #webdeveloper #thedevlife #phpdeveloper #computerscience #programmer #programmingisfun #codingdays
...

How to Modernize IBM i Applications
If you’re like most IBM i users, you know how much value your IBM i data and applications bring to your business. Your end-users, however, may not. In today’s world of rich user experience, fast-paced application development, and constantly evolving customer expectations, IBM i applications are unde…
.
https://hackernoon.com/how-to-modernize-ibm-i-applications

.
Author: Lansa
.
.
.
.
.
#blog #100Daysofcode #javascript #vuejs #datascientist #peoplewhocode #learntocode #coding #developerlife #frontenddeveloper #backenddeveloper #fullstackdeveloper #developer #webdeveloper #thedevlife #phpdeveloper #computerscience #programmer #programmingisfun #codingdays
...