method: Take less in the actual project as an example: .lk-toolbar { .el-input { width: 169px; margin-right: 10px; } > * { margin-bottom: 20px; } } The above code successfully implements the margin-bottom: 20px of all sub-elements under .lk-toolbar This avoids the idiotic task of listing all possible sub-element types: .lk-toolbar { .el-input { width: 169px; margin-right: 10px; margin-bottom: 20px; } .el-button, .el-date-editor { margin-bottom: 20px; } } Application scenarios (effects): Insights (nonsense): At first I wondered if there was such a selector in CSS to select all child elements. Later I looked at the documentation and found that although there was no such selector, the most basic method has been told to you, and the rest depends on your own luck (see if you can use it flexibly!) Tutorial OS: "The methods are all here. It's up to you whether you can use them or not." This concludes this article on how to select all child elements and add styles with CSS. For more information on adding styles to child elements with CSS, please search previous articles on 123WORDPRESS.COM or continue browsing the related articles below. We hope that everyone will support 123WORDPRESS.COM in the future! |
<<: Some common properties of CSS
>>: Implementation code for adding links to FLASH through HTML (div layer)
The author of this article @子木yoyo posted it on hi...
One of the most important features of a style she...
In the past, creating a printer-friendly version ...
Preface WeChat Mini Programs provide new open cap...
The author has been working on a micro-frontend p...
This article shares the specific code of JS to ac...
1. left(name,4) intercepts the 4 characters on th...
If your DOCTYPE is as follows: Copy code The code ...
Here is a single-line layout using ul>li for l...
Run the script in debug mode You can run the enti...
Quoting Baidu's explanation of pseudo-static:...
The pagination component is a common component in...
Table of contents 1. What is an event? 2. Enable ...
yum quick install mysql Add yum repository rpm -U...
Table of contents 1. Basic Introduction to JavaSc...