Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts

    CSS Transform skew()

    When I use this, it also rotates the text. Is there anyway I could prevent this without separating the elements for a skew and text.

  • #2
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,694
    Thanks
    0
    Thanked 232 Times in 227 Posts
    Hi there Sammy12,

    try it like this...
    Code:
    
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="language" content="english"> 
    <meta http-equiv="Content-Style-Type" content="text/css">
    
    <title>skew and unskew</title>
    
    <style type="text/css">
    body {
        background-color:#f0f0f0;
     }
    #container {
        width:630px;
        margin:20px auto;
     }
    #box {
        width:560px; 
        padding:20px;
        background-color:#eef;
        box-shadow:#333 10px 10px 20px;
        -moz-transform:skewx(10deg) translatex(0);
        -moz-transform-origin:bottom left; 
        -moz-perspective:75; 
        -moz-perspective-origin:10% 75%;
        -webkit-transform:skewx(10deg) translatex(0);
        -webkit-transform-origin:bottom left; 
        -webkit-perspective:75; 
        -webkit-perspective-origin:10% 75%;
        -o-transform:skewx(10deg) translatex(0);
        -o-transform-origin:bottom left; 
        -o-perspective:75; 
        -o-perspective-origin:10% 75%;
        -ms-transform:skewx(10deg) translatex(0);
        -s-transform-origin:bottom left; 
        -ms-perspective:75; 
        -ms-perspective-origin:10% 75%;
     }
    #text {
        width:460px; 
        padding:20px;
        margin:0;
        background-color:#fff;
        box-shadow:#333 5px 5px 10px;
        -moz-transform:skewx(-10deg) translatex(0); 
        -moz-transform-origin:bottom left; 
        -moz-perspective:75; 
        -moz-perspective-origin:10% 75%;
        -webkit-transform:skewx(-10deg) translatex(0);
        -webkit-transform-origin:bottom left; 
        -webkit-perspective:75; 
        -webkit-perspective-origin:10% 75%;
        -o-transform:skewx(-10deg) translatex(0);
        -o-transform-origin:bottom left; 
        -o-perspective:75; 
        -o-perspective-origin:10% 75%;
        -ms-transform:skewx(-10deg) translatex(0);
        -ms-transform-origin:bottom left; 
        -ms-perspective:75; 
        -ms-perspective-origin:10% 75%;
     }
    </style>
    
    </head>
    <body>
    
    <div id="container">
    
    <div id="box">
    
    <p id="text">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec 
    ultricies sollicitudin nisi, ut molestie felis adipiscing sit 
    amet. Sed auctor vehicula commodo. Nam a nibh neque, vitae 
    faucibus felis. Vivamus at metus eget eros consequat fringilla. 
    Quisque magna magna, laoreet eu tempus sit amet, fringilla at 
    tellus. Praesent felis tortor, scelerisque vitae fringilla 
    non, porttitor et lacus. Ut ut sapien nec quam tincidunt 
    consectetur in nec lacus.
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec 
    ultricies sollicitudin nisi, ut molestie felis adipiscing sit 
    amet. Sed auctor vehicula commodo. Nam a nibh neque, vitae 
    faucibus felis. Vivamus at metus eget eros consequat fringilla. 
    Quisque magna magna, laoreet eu tempus sit amet, fringilla at 
    tellus. Praesent felis tortor, scelerisque vitae fringilla 
    non, porttitor et lacus. Ut ut sapien nec quam tincidunt 
    consectetur in nec lacus.
    </p><!-- end #text -->
    
    </div><!-- end #box -->
    
    </div><!-- end #container -->
    
    </body>
    </html>
    
    coothead

  • Users who have thanked coothead for this post:

    Sammy12 (02-02-2012)

  • #3
    Registered User
    Join Date
    Jun 2011
    Posts
    1,063
    Thanks
    12
    Thanked 241 Times in 240 Posts
    Thanks so much! For some reason I did this earlier, and it didn't work.

  • #4
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,694
    Thanks
    0
    Thanked 232 Times in 227 Posts
    No problem, you're very welcome.
    coothead


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •