search
HomeWeb Front-endHTML TutorialCSS3实现的3D旋转代码实例_html/css_WEB-ITnose

CSS3实现的3D旋转代码实例:
本章节通过代码实例介绍一下CSS3实现的3D旋转效果,css3的出现可以设置更为强大的效果,3D运动效果就是其中的常用效果之一,下面就是一个这样的代码实例,希望能够给需要的朋友带来一定的参考意义。
代码如下:

 

<!DOCTYPE html><html><head><meta charset=" utf-8"><meta name="author" content="http://www.softwhy.com/" /><title>蚂蚁部落</title><style type="text/css">body, div, ul, li{  padding:0;  margin:0;}.container ul li{  height:180px;  width:180px;  margin-right:20px;  margin-bottom:20px;  display:inline;  -webkit-perspective:1000px;  -moz-perspective:1000px;  float:left;}.out_box{  position:relative;  height:180px;  width:180px;  -webkit-transform-style:preserve-3d;  -moz-transform-style:preserve-3d;  -ms-transform-style:preserve-3d;  transform-style:preserve-3d;  -webkit-transition:0.5s;  -moz-transition:0.5s;  -o-transition:0.5s;  -ms-transition:0.5s;  transition:0.5s;  -webkit-backface-visibility:hidden;  -moz-backface-visibility:hidden;  backface-visibility:hidden;}.out_box div{  display:block;  height:180px;  width:180px;  position:absolute;  left:0;  top:0;  background:#060;  text-align:center;  -webkit-backface-visibility:hidden;  -moz-backface-visibility:hidden;  backface-visibility:hidden;  color:#FFF;  line-height:180px;  font-size:16px;}.out_box .front_box {z-index: 2;}.out_box .back_box {z-index: 1;-webkit-transform: rotateY(180deg);-moz-transform: rotateY(180deg);transform: rotateY(180deg);}.container ul li:hover .out_box{  -webkit-transform:rotateY(180deg);  -moz-transform:rotateY(180deg);  transform:rotateY(180deg);}.container ul li:hover .back_box{  z-index:3;}</style></head><body><div class="container">  <ul>    <li>      <div class="out_box">        <div class="front_box">蚂蚁部落一</div>        <div class="back_box">蚂蚁部落二</div>      </div>    </li>    <li>      <div class="out_box">        <div class="front_box">蚂蚁部落一</div>        <div class="back_box">蚂蚁部落二</div>      </div>    </li>    <li>      <div class="out_box">        <div class="front_box">蚂蚁部落一</div>        <div class="back_box">蚂蚁部落二</div>      </div>    </li>  </ul></div></body></html>

 

以上代码实现了简单的3D旋转效果,具体如何实现这里就不多介绍了,可以参阅本版块相关的章节。

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=13155

更多内容可以参阅:http://www.softwhy.com/divcss/

 

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
HTML in Action: Examples of Website StructureHTML in Action: Examples of Website StructureMay 05, 2025 am 12:03 AM

HTML is used to build websites with clear structure. 1) Use tags such as, and define the website structure. 2) Examples show the structure of blogs and e-commerce websites. 3) Avoid common mistakes such as incorrect label nesting. 4) Optimize performance by reducing HTTP requests and using semantic tags.

How do you insert an image into an HTML page?How do you insert an image into an HTML page?May 04, 2025 am 12:02 AM

ToinsertanimageintoanHTMLpage,usethetagwithsrcandaltattributes.1)UsealttextforaccessibilityandSEO.2)Implementsrcsetforresponsiveimages.3)Applylazyloadingwithloading="lazy"tooptimizeperformance.4)OptimizeimagesusingtoolslikeImageOptimtoreduc

HTML's Purpose: Enabling Web Browsers to Display ContentHTML's Purpose: Enabling Web Browsers to Display ContentMay 03, 2025 am 12:03 AM

The core purpose of HTML is to enable the browser to understand and display web content. 1. HTML defines the web page structure and content through tags, such as, to, etc. 2. HTML5 enhances multimedia support and introduces and tags. 3.HTML provides form elements to support user interaction. 4. Optimizing HTML code can improve web page performance, such as reducing HTTP requests and compressing HTML.

Why are HTML tags important for web development?Why are HTML tags important for web development?May 02, 2025 am 12:03 AM

HTMLtagsareessentialforwebdevelopmentastheystructureandenhancewebpages.1)Theydefinelayout,semantics,andinteractivity.2)SemantictagsimproveaccessibilityandSEO.3)Properuseoftagscanoptimizeperformanceandensurecross-browsercompatibility.

Explain the importance of using consistent coding style for HTML tags and attributes.Explain the importance of using consistent coding style for HTML tags and attributes.May 01, 2025 am 12:01 AM

A consistent HTML encoding style is important because it improves the readability, maintainability and efficiency of the code. 1) Use lowercase tags and attributes, 2) Keep consistent indentation, 3) Select and stick to single or double quotes, 4) Avoid mixing different styles in projects, 5) Use automation tools such as Prettier or ESLint to ensure consistency in styles.

How to implement multi-project carousel in Bootstrap 4?How to implement multi-project carousel in Bootstrap 4?Apr 30, 2025 pm 03:24 PM

Solution to implement multi-project carousel in Bootstrap4 Implementing multi-project carousel in Bootstrap4 is not an easy task. Although Bootstrap...

How does deepseek official website achieve the effect of penetrating mouse scroll event?How does deepseek official website achieve the effect of penetrating mouse scroll event?Apr 30, 2025 pm 03:21 PM

How to achieve the effect of mouse scrolling event penetration? When we browse the web, we often encounter some special interaction designs. For example, on deepseek official website, �...

How to modify the playback control style of HTML videoHow to modify the playback control style of HTML videoApr 30, 2025 pm 03:18 PM

The default playback control style of HTML video cannot be modified directly through CSS. 1. Create custom controls using JavaScript. 2. Beautify these controls through CSS. 3. Consider compatibility, user experience and performance, using libraries such as Video.js or Plyr can simplify the process.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use