Home > Web Front-end > CSS Tutorial > Example of using CSS properties to implement a Christmas tree (picture)

Example of using CSS properties to implement a Christmas tree (picture)

黄舟
Release: 2017-10-21 10:25:47
Original
5017 people have browsed it

For children who are learning front-end, mastering CSS is a must. Today we will draw a Christmas tree using css.

The main practice is the practice and mastery of borders in CSS.

Create a main area in the body

: The triangle we build with border is in the main area.

Change the background color of the main area: You can set a height

##Create the first triangle:

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

Modify the css properties to get the triangle:

The width and sum here Height is actually the length of the inner border, and then sets the properties of the upper, lower, left and right borders respectively, and uses transparent to hide the borders that do not need to be displayed.

Then use the p area to make the trunk:

final effect:

The above is the detailed content of Example of using CSS properties to implement a Christmas tree (picture). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template