ハイパーリンクをクリックして:target
1 つの小さな赤いボックスを黄色の円にし、次に同じ小さなボックスを作成して青い正方形に移行するにはどうすればよいですか?transition
小さな赤い四角のCSSは次のとおりです。
#Redsquare{
height: 15px;
width: 15px;
background-color: rgb(255,0,0);
position: absolute;
top: 330px;
left: 640px;
transition: all 0.5s linear;
}
#Redsquare
これは、黄色の円を対象とするコードです。
#Redsquare:target{
height: 300px;
width: 300px;
border-radius: 50%;
background-color: rgb(255,255,0);
top: 200px;
left: 500px;
}
しかし、別のボタンを押すと、同じ小さな円がブルースクエアにも変わります。