```
<html>
<head>
<style>
? ? ? ? ? ? #main{
? ? ? ? ? ? ? ? border: 1px solid? black;
? ? ? ? ? ? ? ? width: 600px;
? ? ? ? ? ? ? ? height: 500px;
? ? ? ? ? ? }
? ? ? ? ? ? #main>.show{
? ? ? ? ? ? ? ? display: flex;
? ? ? ? ? ? ? ? flex-direction: row;
? ? ? ? ? ? }
? ? ? ? ? ? #main>.show>div{
? ? ? ? ? ? ? ? height: 80px;
? ? ? ? ? ? ? ? width: 80px;
? ? ? ? ? ? ? ? border-radius: 50px;
? ? ? ? ? ? ? ? background-color: lightgray;
? ? ? ? ? ? ? ? margin-left: 50px;
? ? ? ? ? ? }
? ? ? ? ? ? #main>.button{
? ? ? ? ? ? ? ? margin-left: 50px;
? ? ? ? ? ? }
? ? ? ? ? ? #main>.button>button{
? ? ? ? ? ? ? ? width: 70px;
? ? ? ? ? ? ? ? height: 40px;
? ? ? ? ? ? }
</style>
</head>
<body>
</div>
</div>
</div>
</div>
紅燈</button>
黃燈</button>
綠燈</button>
</div>
</div>
</body>
<script>
? ? ? ? function? switchColor(color){
? ? ? ? ? ? document.getElementById("red-button").style.backgroundColor="lightgray";
? ? ? ? ? ? document.getElementById("yellow-button").style.backgroundColor="lightgray";
? ? ? ? ? ? document.getElementById("green-button").style.backgroundColor="lightgray";
? ? ? ? ? ? document.getElementById("red").style.backgroundColor="lightgray";
? ? ? ? ? ? document.getElementById("yellow").style.backgroundColor="lightgray";
? ? ? ? ? ? document.getElementById("green").style.backgroundColor="lightgray";
? ? ? ? ? ? if(color=="red"){
? ? ? ? ? ? document.getElementById("red-button").style.backgroundColor=color;
? ? ? ? ? ? document.getElementById("red").style.backgroundColor=color;
? ? ? ? ? ? }else if(color=="yellow"){
? ? ? ? ? ? document.getElementById("yellow-button").style.backgroundColor=color;
? ? ? ? ? ? document.getElementById("yellow").style.backgroundColor=color;
? ? ? ? ? ? }else{
? ? ? ? ? ? document.getElementById("green-button").style.backgroundColor=color;
? ? ? ? ? ? document.getElementById("green").style.backgroundColor=color;
? ? ? ? ? ? }
? ? ? ? }
</script>
</html>
```