HTML Academy
Centering with transform: translate
2D Transforms19/32
Back to the list of tasks
  • 1. Moving objects horizontally
  • 2. Moving objects vertically
  • 3. Fireball training
  • 4. Increasing and decreasing the size
  • 5. Defending the city
  • 6. The beginning of the journey
  • 7. The maze
  • 8. The battle, part 1
  • 9. The battle, part 2
  • 10. Test: The mysterious card
  • 11. The battle, part 3
  • 12. Test: The shattered crystal
  • 13. The final battle
  • 14. Features of transform-origin, part 1
  • 15. Features of transform-origin, part 2
  • 16. Features of transform-origin, part 3
  • 17. Features of transform-origin, part 4
  • 18. Centering with transform: translate
  • 19. Rotating the text in blocks
  • 20. Rotating the text in the background
  • 21. Custom shadows
  • 22. On-hover effects: buttons, part 1
  • 23. On-hover effects: buttons, part 2
  • 24. On-hover effects: buttons, part 3
  • 25. On-hover effects: the gallery
  • 26. The “stack” of cards
  • 27. Preparing the round menu
  • 28. Round menu, step 1
  • 29. Round menu, step 2
  • 30. Round menu, step 3
  • 31. The round menu, final part
  • 32. Test: Arranging the cards
Rotating the text in the background
  • Sign up
  • Log in

Loading…
Everything will be ready in few seconds

  • Theory
  • Theory
  • Comments

Rotating the text in blocks

This is where the adventures of the wizard Pendalf end, so let’s return to the real world and look at techniques for creating interface elements and decorative effects using CSS transforms.

In this assignment, we will turn the article title upside down and place it on its side. To do this, we will use the already familiar properties transform-origin and transform: rotate.

Comments

  • index.html
  • style.css
HTML
<!DOCTYPE html> <html lang="en"> <head> <title>Rotating the text in blocks</title> <meta charset="utf-8"> <link rel="stylesheet" href="style.css"> </head> <body> <article> <h1>Collinear Vectors</h1> <p>A divergent series generates a collinear Cauchy’s criterion for convergence, which is something that even grammar school students know. It has not been proven that the Taylor series specifies an abstract vector, thereby clearly proving all of the nonsense laid out above.</p> <p>The Gauss-Ostrogradsky Theorem neutralizes the axiomatic double integral, which is not surprising. Without going into details, we can say that the irrational number directly orders the aspiring triple integral, which is what we were asked to prove. It is easy to verify that Fermat’s theorem is able to shed light on the complex graph of a function. We will leave the further calculations for students to complete as a simple homework assignment.</p> </article> </body> </html>
CSS
body { margin: 0; padding: 0; background-color: #f5f5f5; font-family: "Arial Narrow", "Arial", sans-serif; } article { position: relative; max-width: 400px; margin: 50px auto; padding: 1px 20px; line-height: 1.5; background-color: white; box-shadow: 0 0 3px #cccccc; } h1 { margin: 0.7em 0; }

What didn’t you like in this task?

Thanks! We’ll fix everything at once!

The code has changed, click “Refresh” or turn autorun on.

You’ve gone to a different page

Click inside the mini-browser to shift the focus onto this window.

100%
Goalscompleted
0
    1. For h1, assign absolute positioning and the coordinates top — 10px and  left — 0.
    2. Then assign article a solid border on the left (border-left) that is 40px thick and has the color #7fdbff.
    3. For h1, set transform-origin to the value 0 0, and rotate it 90° clockwise.

    Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2025

    VISAMastercard

    Log in

    or

    Forgot your password?

    Sign up

    Sign up

    or
    Log in

    Restore access

    Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.

    Forgot to connect your email to the profile? Email us and we’ll help.