要素を画面の下部に表示する方法

HTML と CSS で、要素を画面の下部に表示する方法です。 CSS で position を fixed、bottom に 0px とします。

<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title></title>
<style>
.bottom {
position: fixed;
bottom: 0px;
background: red;
height: 40px;
width: 100px;
}
</style>
</head>
<body>
<div class="bottom">テキスト</div>
</body>
</html>

💬 コメント