Scenario 1: To achieve a semi-transparent border: Due to the default behavior of CSS styles, the background color is rendered in the range of content+padding+border. The semi-transparent border is affected by the main color, and the effect achieved is Solution: Use the background-clip property to specify the background drawing area so that the drawing area is limited to content + padding. Div { border:10px solid rgba(0,0,0,.5); background: lightblue; background-clip: padding-box; } Supplement: background-clip is not compatible with IE6-8, Opera10 Scenario 2: To implement multiple borders: Solution 1: Use box-shadow to generate multiple projections The code and effect are as follows: div { background:#c3e6f4; box-shadow:0 0 0 15px #b7dae6,0 0 0 30px #cce2ea; } Solution 2: Box border combined with stroke attributes (outline) Features: Only double borders can be achieved, more flexible, and can use dotted line and other effects The code and effect are as follows: div { border: 6px dashed #c3f4ec; outline: 10px solid #d9faf6; background-clip: padding-box; } Summarize The above is the scenario analysis of implementing semi-transparent borders and multiple borders with CSS introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! |
<<: TypeScript problem with iterating over object properties
>>: Summary of MySQL slow log related knowledge
Table of contents Zabbix monitors Nginx Zabbix mo...
● I was planning to buy some cloud data to provid...
1. Introduction to yum Yum (full name Yellow dogU...
CentOS8 was released a few days ago. Although it ...
There are two common ways to download files in da...
1. Overview MySQL version: 5.6.21 Download addres...
Logo optimization: 1.The logo image should be as ...
Abstract: MySQL provides a variety of storage eng...
Table of contents 1. Create a sql script file con...
1. Introduction to MySQL permissions There are 4 ...
Table of contents 1. Vue3 component communication...
Before introducing the new CSS property contain, ...
Preface This article introduces a tutorial on how...
1. Create users and authorize Creating users and ...
Table of contents Where are the logs stored? View...