Danh ngôn cuộc sống:
• Bài viết được đăng bởi: Mr. Phan Nhan• Ngày cập nhật bài viết: 14/05/2016• Tổng lược xem trang: 187 / 1 khách• Đánh giá bởi người dùng: |
Định nghĩa và sử dụng. Thông thường khi nhìn một thành phần ta sẽ thấy thành phần có dạng 2D (chiều rộng và chiều cao), để nhìn vật thể 3D ta cần có thêm chiều sâu, thuộc tính perspective sẽ cho ta thấy được chiều sâu của thành phần, khoảng chiều sâu được tính từ điểm đặt ban đầu tới giá trị của perspective (theo đơn vị pixel). Cấu trúc:
tag {
perspective: giá trị;
}
HTML viết:perspective: giá trị;
}
<html>
<head></head>
<body>
<div>
<p>perspective.</p>
</div>
</body>
</html>
CSS viết:<head></head>
<body>
<div>
<p>perspective.</p>
</div>
</body>
</html>
div {
perspective: 300;
-moz-perspective: 300;
-webkit-perspective: 300;
-o-perspective: 300;
-ms-perspective: 300;
}
p {
background: #cc0000;
height: 100px;
width: 100px;
position: absolute;
transform: rotateX(45deg);
-moz-transform: rotateX(45deg);
-webkit-transform: rotateX(45deg);
-o-transform: rotateX(45deg);
-ms-transform: rotateX(45deg);
}
perspective: 300;
-moz-perspective: 300;
-webkit-perspective: 300;
-o-perspective: 300;
-ms-perspective: 300;
}
p {
background: #cc0000;
height: 100px;
width: 100px;
position: absolute;
transform: rotateX(45deg);
-moz-transform: rotateX(45deg);
-webkit-transform: rotateX(45deg);
-o-transform: rotateX(45deg);
-ms-transform: rotateX(45deg);
}
Những bài viết được đăng mới nhất. 



