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
I am writing a small program recently. Because th...
This article example shares the specific code of ...
Solution to forgetting MySQL password: [root@loca...
We need to first combine the air quality data wit...
Problem Description As we all know, when writing ...
This situation usually occurs because the Chinese...
Download the rpm installation package MySQL offic...
The following functions are implemented: 1. Usern...
1. The emergence of the problem Wrote a flat list...
When making some pages, in order to make the page...
This article shares the specific code of js to ac...
After being tortured by the front-end cross-domai...
I don’t know why, but UI likes to design honeycom...
I had always wanted to learn Kubernetes because i...
Table of contents First Look Index The concept of...