Create a variety of different shape shapes with CSS only

Source: Internet
Author: User

Introduced

Today, we're going to learn how to use simple CSS to create different types of planar graphics.

Using code

Rectangular

. rectangle {    width:250px;    height:150px;    Background-color: #6DC75F;} <p></p>

Triangle

. triangleup {            border-left:75px solid transparent;            border-right:75px solid transparent;            border-bottom:150px solid  #6DC75F;            width:0;            height:0;        } <p class= "Triangleup" ></p>

Elliptic

. oval {    width:300px;    height:150px;    Background: #6DC75F;    -moz-border-radius:150px/75px;    -webkit-border-radius:150px/75px;    border-radius:150px/75px;} <p class= "Oval" ></p>

Crescent

. Moon {  width:150px;  height:150px;  border-radius:50%;  box-shadow:15px 15px 0 0 Green;} <p class= "Moon" ></p>

Leaves

. Leaf {    border-radius:5px 300px 3px 300px;    Background: #6DC75F;    width:150px;    height:150px;} <p class= "Leaf" ></p>

Points of interest

CSS allows you to do a lot of amazing things ... I wish you a happy coding!

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.