Grow your CSS skills. Land your dream job.

Div at an angle?

  • # October 23, 2009 at 9:57 am

    Hi,

    Is it possible to place a div and an angle on a website rather than always flat on the horizontal plane? Can CCS do this ?

    John C

    # October 23, 2009 at 10:16 am

    As far as I know, no, you can’t have a div at an angle. You would need to fake it using images or some other method.

    # October 23, 2009 at 11:29 am

    yea.. at least CSS 2 doesn’t support it yet.. may be CSS 3.0 might support something like that?

    # October 23, 2009 at 1:02 pm

    possible? yes with CSS3

    http://dingledoodle.com/rotate/start.html

    but I wouldn;t recommend it, it makes the text unreadable.

    Code:
    -moz-transform:rotate(35deg);
    -webkit-transform:rotate(35deg);
    # October 25, 2009 at 12:53 pm

    Hi,

    Thanks for the replies – the CSS3 code works really well – very useful to know.

    John C :

    # November 13, 2011 at 1:10 am

    Wow. Thanks! I am just starting to learn CSS3, and this trick has already impressed me. You were right, the text inside indeed becomes distorted, which makes it clear that this is the trick Google Gravity uses to finally place the element at different angles, as the text inside those boxes is distorted in the same way as well.

    # November 13, 2011 at 7:55 am

    Check out this site: CSS3 Please… it’s a great help! It also builds css that works in IE, if it is possible. Also, with large enough text, the rotation shouldn’t make it unreadable.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".