- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to specify the perspective on how 3D elements are viewed
Use the CSS perspective property to specify the perspective on how 3D elements are viewed.
You can try to run the following code to achieve this
Example
<!DOCTYPE html> <html> <head> <style> .demo1 { position: relative; width: 150px; height: 150px; background-color: yellow; perspective: 80px; margin: 50px; } .demo2 { position: absolute; padding: 20px; background-color: orange; transform-style: preserve-3d; transform: rotateX(45deg); } </style> </head> <body> <h1>Rotation</h1> <div class = "demo1">Demo <div class = "demo2">Demo </div> </div> </body> </html>
Advertisements