The specific code is as follows: The html code is as follows <div class="arrow-up"> <!--Upward triangle--> </div> <div class="arrow-down"> <!--Downward triangle--> </div> <div class="arrow-left"> <!--Left-pointing triangle--> </div> <div class="arrow-right"> <!--Rightward triangle--> </div> Below we use CSS3 to implement the upward, downward, left and right triangles respectively /*arrow up*/ .arrow-up { width:0; height:0; border-left:30px solid transparent; border-right:30px solid transparent; border-bottom:30px solid #fff; } /*arrow down*/ .arrow-down { width:0; height:0; border-left:20px solid transparent; border-right:20px solid transparent; border-top:20px solid #0066cc; } /*Arrow pointing left*/ .arrow-left { width:0; height:0; border-top:30px solid transparent; border-bottom:30px solid transparent; border-right:30px solid yellow; } /*arrow right*/ .arrow-right { width:0; height:0; border-top:50px solid transparent; border-bottom: 50px solid transparent; border-left: 50px solid green; } Mini Program Example wxml <view class="index_sale_lists"> <view class="sanjiao"></view> <view class="index_sale_list"> <view class="index_sale_choice">You have chosen: <text>Shangnao</text></view> <view class="index_sale_tezhi"> <text> Characteristics: Beef topside is located at the back of the shoulder and neck, on both sides of the spine. The meat is tender and juicy, the fat is evenly distributed, and it has beautiful marble patterns. It has a soft texture and melts in the mouth. It is low in fat and high in protein. It is suitable for hot pot, and can be fried, deep-fried and grilled. </text> </view> </view> </view> wxss .index_sale_lists{ margin: 50rpx 24rpx 0; background-color: #F2F6F4; border-radius: 20rpx; position: relative; } .sanjiao{ position: absolute; left: 50%; top:-15rpx; width:0; height:0; border-left:10px solid transparent; border-right:10px solid transparent; border-bottom:10px solid #F2F6F4; /* z-index: -1; */ } Summarize This is the end of this article about how to use pure CSS3+DIV to achieve a small triangular border. For more relevant CSS div content about achieving a triangular border, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! |
<<: Summary of the top ten problems of MySQL index failure
>>: Div covers the flash. Flash transparent method realizes placing the DIV layer on the flash.
Preface Linux has corresponding open source tools...
-9999 px image replacement technology has been pop...
Preface The company's Ubuntu server places th...
Related reading: MySQL8.0.20 installation tutoria...
This article shares the specific code of js+canva...
1. Log in to MySQL and use SHOW VARIABLES LIKE ...
Table of contents Set a not null constraint when ...
1. Before configuring the IP address, first use i...
I can log in to MYSQL normally under the command ...
1. Enter the host machine of the docker container...
Table of contents Brief Introduction setInterval ...
This article example shares the specific code of ...
1. The first method is to use the unhup command d...
Table of contents 1. Index Type 1. B+ Tree 2. Wha...
How to set up a MySQL short link 1. Check the mys...