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.
It can be referenced through CDN (Content Delivery...
Shopify Plus is the enterprise version of the e-c...
This article compares and summarizes four ways of...
01. Overview Absolute paths and relative paths ar...
Today, I fell into the trap again. I have encount...
Table of contents Overview Getting started with d...
This article uses an example to illustrate the us...
Docker runs multiple Springboot First: Port mappi...
This article example shares the specific code of ...
Modify the simplified file size and download the ...
Execute the following command to report an error ...
The commonly used Oracle10g partitions are: range...
Table of contents A simple component example More...
We often need to control the hidden, transparent ...
mysql create table sql statement Common SQL state...