Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

105
Views
Prevent parent to trigger transition if a child is clicked

I have a .card that changes its scale when :active. But I don't want this rule to run if a button within this .card is clicked.

To better illustrate the situation, this is my current code:

.html:

<div class="card">
  <h1>Card</h1>
  
  <button>Click me</button>
</div>

.css:

.card {}

.card:active {
  transform: scale(0.9);
}

button {
  /** ? **/
}

To better illustrate the situation, here's a demo of what's going on: https://codepen.io/chiefGui/pen/BaJoVvg

I lack ideas on how to overcome this situation via HTML/CSS only - so, what would you do?


Note: The solution I'm looking for is a way to solve the problem without JavaScript interference (if possible at all).

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!