Home > Web Front-end > CSS Tutorial > Rotate y-axis tilted div using CSS

Rotate y-axis tilted div using CSS

PHPz
Release: 2023-09-21 20:01:07
forward
889 people have browsed it

使用 CSS 旋转 y 轴倾斜的 div

You can try running the following code to use CSS to tilt-rotate the div along the y-axis -

Example

Demo

<html>
   <head>
      <style>
         div {
             width: 300px;
             height: 100px;
             background-color: pink;
             border: 1px solid black;
          }
          div#skewDiv {
             /* IE 9 */
             -ms-transform: skewY(20deg);
             /* Safari */
             -webkit-transform: skewY(20deg);
             /* Standard syntax */
             transform: skewY(20deg);
          }
      </style>
   </head>
   <body>
      <div>
         Welcome to my website.
      </div>
      <div id = "skewDiv">
         Welcome to my website.
      </div>
   </body>
</html>
Copy after login

The above is the detailed content of Rotate y-axis tilted div using CSS. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template