Use css properties to draw a Christmas tree, and css properties for the Christmas tree
Css is essential for learning the front-end shoes. Today, we will use css to draw a Christmas tree.
The main exercise is the border practice and mastery in css.
Create a main area in the body <div> </div>:The triangle built 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 represents a rectangle, and then the triangle is obtained by modifying the rectangle.
Modify the css attribute to get the triangle:
The width and height here are actually the length of the border on the inner side, and then respectively set the attributes of the upper and lower sides of the border, and use transparent to hide the border that does not need to be displayed.
Then use the div area as the trunk:
Final effect: