How to draw a Christmas tree with CSS properties

Source: Internet
Author: User
For learning the front-end children's shoes, CSS mastery is a must. Today is the realization of the use of CSS to draw a Christmas tree.

The main practice is the CSS inside border practice and mastery degree.

Create a main area in body <p></p>: We use border to build a triangle inside the main area.

to change the background color of the main area: can be set to a height

Create a first triangle:

Each area here represents a rectangle and then the triangle is obtained by modifying the rectangle

Modify CSS properties to get a triangle:

Here the width and height is actually the length of the inside border, and then set the border and the left and right of the property, with transparent hide the border do not need to show.

Then use the P area to do the trunk:

Final effect:

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.