【CSS】right - 要素の位置(右)
CSSのrightプロパティをご紹介します。
right
rightは要素の右端の位置を示すプロパティです。
基本構文
right: 値;
サンプル
<style>
.container {
position: relative;
padding: 15px;
background: lightgray;
}
.box {
height: 100px;
background: yellow;
}
p {
margin: 0;
position: absolute;
right: 0;
}
</style>
<div class="container">
<div class="box"></div>
<hr>
<p>TEXT</p>
<div class="box"></div>
</div>