Mind Map He probably looks like this: Most of the implementations on the Internet are implemented using d3.js, and some are implemented manually using svg. Recently, my work requires it, and I am very lazy, so I am wondering if it can be implemented using CSS3? The answer is yes. Here is the code HTML code <div class="mainBody" id="node1"> <h1>node1</h1> <div class="oneBody"> <div class="mainBody"> <h1>node2</h1> <div class="oneBody"> <div class="mainBody"> <h1>node3</h1> <div class="oneBody"> <div class="mainBody"> <h1>node4</h1> </div> <div class="mainBody"> <h1>node4</h1> </div> <div class="mainBody"> <h1>node4</h1> </div> </div> </div> <div class="mainBody"> <h1>node3</h1> </div> <div class="mainBody"> <h1>node3</h1> </div> </div> </div> <div class="mainBody"><h1>node2</h1></div> <div class="mainBody"><h1>node2</h1></div> </div> </div> CSS3 code .mainBody{ display: -webkit-flex; /* Safari */ display: flex; flex-direction: row; justify-content: flex-start ; } .sbody{ } .oneBody{ display: -webkit-flex; /* Safari */ display: flex; flex-direction: column; justify-content: space-around; } #node1{ /*height: 200px;*/ margin-top: 100px; margin-left: 100px; } h1{ line-height: 100%; display: -webkit-flex; /* Safari */ display: flex; flex-direction: column; justify-content: center; } The actual effect is as shown below: Oh, it's a bit crude... But you can do whatever you want with the style. To add nodes, you only need to add the corresponding node code in HTML. The height and position are adaptive. Thanks to CSS3 flex, you are lucky to live in this era. 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 the process of building Prometheus+Grafana based on docker
MySQL's CAST() and CONVERT() functions can be...
Table of contents Scene Introduction Plugin Imple...
I finished learning SQL by myself not long ago, a...
Preface In fact, the humble "!" has man...
Table of contents LAMP architecture 1.Lamp Introd...
Table of contents Prerequisites useEffect commitB...
Table of contents What is Vuex? Vuex usage cycle ...
Table of contents Results at a Glance Heart Effec...
The concept of relative path Use the current file...
Absolute length px px is the pixel value, which i...
This article uses examples to illustrate the prin...
When you first start learning Linux, you first ne...
1. What is floating? Floating, as the name sugges...
<!DOCTYPE HEML PUBLIC> <html> <hea...
Table of contents Install vim plugin manager Add ...