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
Kernel: [root@opop ~]# cat /etc/centos-release Ce...
Table of contents background analyze Data simulat...
Table of contents 1. CDN introduction 1.1 react (...
Table of contents Code: Replenish: Summarize Requ...
First of all, what is a font icon? On the surface...
1. Create a test table CREATE TABLE `testsign` ( ...
Preface A classmate is investigating MLSQL Stack&...
Table of contents Local Mixin Global Mixins Summa...
Folding display multi-line text component Fold an...
Original article: Ultimate IE6 Cheatsheet: How To...
This article guide: There are two ways to delete ...
Table of contents Problem Description What is Vue...
This article shares the specific code of js to ac...
Disclaimer: Since the project requires the use of...
1. Two ways to define react components 1. Functio...