0

ナビゲーションのウェブサイトのレイアウトの下にあるウェブサイトでは、ボタンにカーソルを合わせると上昇し、マウスを離すと沈みます.cssまたは他の方法でそれを行う方法は?

www.bigfishgames.com/

4

1 に答える 1

0

プレーンCSSでそれを行うことができます:

<!DOCTYPE html>
<html>
<head>
<style>
div { border-radius: 4px; width: 100px; height: 20px; background: green; position: absolute; top: 50px; left: 50px; text-align: center; padding: 10px 0px; }
div:hover { top: 40px; padding-bottom: 20px; }
</style>
</head>
<body>
<div>Howdy</div>
</body>
</html>

padding-bottomとの両方がどのように変更され、が「上向き」に拡大しheightているという錯覚を与えることに注意してください。div

于 2012-09-26T11:18:05.547 に答える