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

164
Views
Change CSS transform perspective on click

Lets say this is my website:

* {
  font-size: 80px;
  text-transform: uppercase;
  font-family: sans-serif;
}

html {
background: yellow;

}

span {
  display: inline-block;
  transform: skew(-60deg, 0deg);
  transition: transform 0.5s linear;
  color: white;
  box-shadow: 0 0 30px red;
letter-spacing: 3em;
}
<div id="one">H<span>e</span>ll<span>o</span></div>

Is there a way to click the letters e or o and then this is shown with a top view while the whole page gets transformed in the same amount?

Love

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

This is not possible with only CSS, so with a few JavaScript we can do the following:

e.addEventListener('click', () => {
  document.body.setAttribute('data-skew', 'e');
});
o.addEventListener('click', () => {
  document.body.setAttribute('data-skew', 'o');
});
* {
  font-size: 80px;
  text-transform: uppercase;
  font-family: sans-serif;
}

html {
  background: yellow;
}

body[data-skew='e'] {
  transform: skew(60deg, 0deg);
}
body[data-skew='o'] {
  transform: skew(0deg, 0deg);
}

span {
  display: inline-block;
  transform: skew(-60deg, 0deg);
  transition: transform 0.5s linear;
  color: white;
  box-shadow: 0 0 30px red;
  letter-spacing: 3em;
}
<div id="one">H<span id="e">e</span>ll<span id="o">o</span></div>

about 4 years ago · Juan Pablo Isaza Report
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!