Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Before you can transform an element in 3D, you need to establish a 3D perspective on the page, otherwise, your transforms will still appear flat and two-dimensional. To define 3D space, you can use the 'perspective' property.
.photo
selector shown in the video, you will want to use the .photo-container
selector for the transform rotate rules..content {
perspective: 700px;
}
.photo-container {
transform: rotateY(55deg)
}
Resources
Video review
- Perspective is what separates 3D transforms from 2D transforms.
- You define 3D space with the 'perspective' property.
- The
perspective
property creates the illusion of depth; it sets how far away or how close objects appear to us. - You can apply the
perspective
property to the<body>
, a<div>
, or any block-level element. - The value for
perspective
can be set in pixels, em, or rem. - When you enable 3D space with
perspective
, the smaller the value, the deeper the perspective; the greater the value, the shallower the perspective. - A value between
500px
and800px
usually renders a realistic perspective. - If you delete the
perspective
property at any time, you will lose the 3D effect on your page.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Nicholas Prober
4,926 Points2 Answers
-
nicolaspeterson
8,569 Points1 Answer
-
Jake Almendarez
Front End Web Development Techdegree Student 4,250 Points1 Answer
-
Erin Clayton
3,840 PointsIssues w/ Firefox browser, unsure why? Have checked the values in CSS, brackets closed,and they are correct...?
Posted by Erin ClaytonErin Clayton
3,840 Points2 Answers
-
Audra Ogilvy
3,142 Points"The value (of the perspective property) can be in pixels, ems, or rems." What are rems? And is the syntax "rem"?
Posted by Audra OgilvyAudra Ogilvy
3,142 Points1 Answer
-
Saqib Ali
3,686 Points2 Answers
-
AYA AYA
5,423 Points3D Transforms
Posted by AYA AYAAYA AYA
5,423 Points1 Answer
-
Zeljko Porobija
11,491 Points5 Answers
-
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsThere are some things about 3D space that don't make sense to me.
1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up