-1
我在一個div下面放置了一個圖像和不同大小的文本。在盤旋時,我希望一切都變大,但保持相同的比例。我怎樣才能做到這一點,而無需手動爲每個元素找到完美的過渡大小?如何使一個div中的所有內容以相同的比例展開
我在一個div下面放置了一個圖像和不同大小的文本。在盤旋時,我希望一切都變大,但保持相同的比例。我怎樣才能做到這一點,而無需手動爲每個元素找到完美的過渡大小?如何使一個div中的所有內容以相同的比例展開
只是變換股利
div:hover{
transform:scale(0.8);
transform-origin: top left;
transition: transform 200ms;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div>
<img src="https://unsplash.it/458/354?image=0" alt="hi" width="300px" >
<br>
<h1> hello there </h1>
</div>
</body>
</html>
有沒有辦法有鏈接到CSS3過渡,雖然規模轉型?我正在嘗試 轉換:縮放1s線性; 但它不起作用 – user7548189
編輯答案..你需要'轉型:轉換1s'而不是'scale' –