Certainly! Below is a complete HTML file that visually demonstrates how a main concept (e.g., "Math Operations") connects to its child concepts (Addition, Subtraction, Multiplication, Division).
This example uses CSS for styling and lines, and JavaScript to allow you to click on each child to see a brief description.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Concept Map: Math Operations</title>
<style>
body {
font-family: Arial, sans-serif;
background: #f4f8fb;
margin: 0;
padding: 0;
}
.container {
width: 700px;
margin: 60px auto;
position: relative;
background: #fff;
border-radius: 12px;
box-shadow: 0 4px 24px rgba(0,0,0,0.08);
padding: 60px 0 40px 0;
}
.main-concept {
width: 220px;
margin: 0 auto;
background: #1976d2;
color: #fff;
text-align: center;
padding: 22px 0;
border-radius: 12px;
font-size: 1.5em;
font-weight: bold;
position: relative;
z-index: 2;
box-shadow: 0 2px 8px rgba(25,118,210,0.12);
}
.children {
display: flex;
justify-content: space-around;
margin-top: 90px;
position: relative;
z-index: 2;
}
.child {
width: 140px;
background: #fff;
border: 2px solid #1976d2;
color: #1976d2;
text-align: center;
padding: 18px 0;
border-radius: 10px;
font-size: 1.1em;
font-weight: 500;
cursor: pointer;
transition: background 0.2s, color 0.2s;
position: relative;
z-index: 2;
}
.child:hover {
background: #1976d2;
color: #fff;
}
/* Draw lines using absolute positioned divs */
.line {
position: absolute;
left: 50%;
transform: translateX(-50%);
width: 4px;
height: 60px;
background: #1976d2;
top: 70px;
z-index: 1;
}
.line-horizontal {
position: absolute;
top: 130px;
left: 110px;
width: 480px;
height: 4px;
background: #1976d2;
z-index: 1;
}
.line-vertical {
position: absolute;
width: 4px;
height: 40px;
background: #1976d2;
z-index: 1;
}
.line-vertical.child1 { left: 140px; top: 130px; }
.line-vertical.child2 { left: 260px; top: 130px; }
.line-vertical.child3 { left: 380px; top: 130px; }
.line-vertical.child4 { left: 500px; top: 130px; }
/* Tooltip/Description */
.description {
margin: 30px auto 0 auto;
width: 80%;
min-height: 40px;
background: #e3f2fd;
color: #1976d2;
border-radius: 8px;
padding: 16px;
font-size: 1.1em;
text-align: center;
display: none;
box-shadow: 0 2px 8px rgba(25,118,210,0.08);
}
.description.active {
display: block;
animation: fadeIn 0.3s;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@media (max-width: 800px) {
.container { width: 98vw; }
.children { flex-direction: column; align-items: center; margin-top: 60px; }
.child { margin-bottom: 18px; }
.line-horizontal, .line-vertical { display: none; }
.line { display: none; }
}
</style>
</head>
<body>
<div class="container">
<div class="main-concept">Math Operations</div>
<!-- Lines connecting parent to children -->
<div class="line"></div>
<div class="line-horizontal"></div>
<div class="line-vertical child1"></div>
<div class="line-vertical child2"></div>
<div class="line-vertical child3"></div>
<div class="line-vertical child4"></div>
<!-- Children -->
<div class="children">
<div class="child" data-desc="Addition is the process of finding the total or sum by combining two or more numbers. Example: 2 + 3 = 5">Addition</div>
<div class="child" data-desc="Subtraction is the process of finding the difference between two numbers. Example: 5 - 2 = 3">Subtraction</div>
<div class="child" data-desc="Multiplication is repeated addition. It finds the total of one number taken multiple times. Example: 3 × 4 = 12">Multiplication</div>
<div class="child" data-desc="Division is splitting a number into equal parts. Example: 12 ÷ 3 = 4">Division</div>
</div>
<div class="description" id="descBox"></div>
</div>
<script>
const children = document.querySelectorAll('.child');
const descBox = document.getElementById('descBox');
children.forEach(child => {
child.addEventListener('click', () => {
descBox.textContent = child.getAttribute('data-desc');
descBox.classList.add('active');
});
});
// Hide description when clicking outside
document.body.addEventListener('click', (e) => {
if (!e.target.classList.contains('child')) {
descBox.classList.remove('active');
}
});
</script>
</body>
</html>
How it works:
- The main concept ("Math Operations") is at the top.
- Four child concepts are below, connected by lines.
- Clicking a child shows its description below.
- Responsive for mobile (lines hide, children stack).
You can copy and run this file directly in your browser!
Let me know if you want a different concept or more features.