calc is a function in CSS that is used to calculate numerical values. It can calculate length, angle, time, etc. Supports The effect of the example display An example using the cacl layout I want to create an effect where the background of CSS Code #div1 { width: 100%; min-width: 400px; outline: blue; } #div2 { width: 300px; margin: 0 auto; outline: 1px solid #ccc; color: white; } HTML code <div id="div1" class="cw"> <div id="div2"> test </div> </div> Solution .cw { background:blue linear-gradient( to right, red calc(50% - 150px + 60px ) , transparent calc(50% - 150px + 60px ) ); } cacl compatibility The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. |
<<: Detailed explanation of encoding issues during MySQL command line operations
>>: Parameters to make iframe transparent
In daily operation and maintenance work, nginx se...
This article example shares the specific code of ...
Table of contents 1. Shared CommonModule 2. Share...
Table of contents 1. Overview of MySQL Logical Ar...
In actual use, it is often necessary to share the...
Table of contents Prune regularly Mirror Eviction...
Table of contents Preface Lua Script nignx.conf c...
Table of contents 1. Modify the my.cnf file of se...
(I) Method 1: Define it in advance directly in th...
I usually like to visit the special pages or prod...
Yesterday I wanted to use a:visited to change the...
#include <asm/io.h> #define ioremap(cookie,...
This article uses examples to illustrate the comm...
1. If the user has the create routine permission,...
Table of contents 1. Introduction Second practice...