CSS methods for drawing various graphs

Source: Internet
Author: User

CSS methods for drawing various graphs

Square (Square)

#square {    width:100px;    height:100px;    backgroud:red;}

Rectangle (Rectangle)

#rectangle {    width:200px;    height:100px;    background:red;

Circle (Circle)

#circle {    width:100px;    height:100px;    background:red;    -moz-border-radius:50px;    -webkit-border-radius:50px;    border-radius:50px;}

/can use percent value (greater than 50%), but low version of Android does not support/

Oval (Oval)

#oval {    width:200px;    height:100px;    background:red;    -moz-border-radius:100px/50px;    -webkit-border-radius:100px/50px;    border-radius:100px/50px;}

/can use percent value (greater than 50%), but low version of Android does not support/

Triangle up (triangle up)

#triangle-up {    width:0;    height:0;    border-left:50px solid transparent;    border-right:50px solid transparent;    border-bottom:100px solid Red;}

Triangle Down (downward)

#triangle-down {    width:0;    height:0;    border-left:50px solid transparent;    border-right:50px solid transparent;    border-top:100px solid Red;}

Triangle Left (leftwards)

#triangle-left {    width:0;    height:0;    border-top:50px solid transparent;    border-right:100px solid red;    border-bottom:50px solid Transparent;}

Triangle Right (Rightwards)

#triangle-right {    width:0;    height:0;    border-top:50px solid transparent;    border-left:100px solid red;    border-bottom:50px solid Transparent;}


CSS methods for drawing various graphs


Square (Square)

#square {    width:100px;    height:100px;    backgroud:red;}

Rectangle (Rectangle)

#rectangle {    width:200px;    height:100px;    background:red;

Circle (Circle)

#circle {    width:100px;    height:100px;    background:red;    -moz-border-radius:50px;    -webkit-border-radius:50px;    border-radius:50px;}

/can use percent value (greater than 50%), but low version of Android does not support/

Oval (Oval)

#oval {    width:200px;    height:100px;    background:red;    -moz-border-radius:100px/50px;    -webkit-border-radius:100px/50px;    border-radius:100px/50px;}

/can use percent value (greater than 50%), but low version of Android does not support/

Triangle up (triangle up)

#triangle-up {    width:0;    height:0;    border-left:50px solid transparent;    border-right:50px solid transparent;    border-bottom:100px solid Red;}

Triangle Down (downward)

#triangle-down {    width:0;    height:0;    border-left:50px solid transparent;    border-right:50px solid transparent;    border-top:100px solid Red;}

Triangle Left (leftwards)

#triangle-left {    width:0;    height:0;    border-top:50px solid transparent;    border-right:100px solid red;    border-bottom:50px solid Transparent;}

Triangle Right (Rightwards)

#triangle-right {    width:0;    height:0;    border-top:50px solid transparent;    border-left:100px solid red;    border-bottom:50px solid Transparent;}
More CSS how to draw various graphics related articles please follow topic.alibabacloud.com!
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.