CARVIEW |
Select Language
HTTP/2 200
content-type: text/html
x-guploader-uploadid: AAwnv3KKVxN1B0Y-Kq9SLNbqgHZvcB6xw0SPML-MXhQWVk1aLHMubuguQA3n6ixQLoqxDa6n
cache-control: public, max-age=3600
expires: Tue, 07 Oct 2025 08:42:05 GMT
last-modified: Tue, 07 Oct 2025 01:15:33 GMT
etag: W/"654066d359cef40802a18335bdb8cf27"
x-goog-generation: 1759799732988935
x-goog-metageneration: 1
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 286611
x-goog-meta-goog-reserved-file-mtime: 1759797522
x-goog-hash: crc32c=OQ4wzg==, md5=ZUBm01nO9AgCoYM1vbjPJw==
x-goog-storage-class: STANDARD
accept-ranges: none
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
alt-svc: clear
referrer-policy: strict-origin-when-cross-origin
x-content-type-options: nosniff
strict-transport-security: max-age=63072000
content-security-policy: default-src 'self'; script-src 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://www.googletagmanager.com/gtag/js assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; script-src-elem 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://www.googletagmanager.com/gtag/js assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; style-src 'report-sample' 'self' 'unsafe-inline'; object-src 'none'; base-uri 'self'; connect-src 'self' developer.allizom.org bcd.developer.allizom.org bcd.developer.mozilla.org updates.developer.allizom.org updates.developer.mozilla.org https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://incoming.telemetry.mozilla.org https://observatory-api.mdn.allizom.net https://observatory-api.mdn.mozilla.net https://api.github.com/search/issues stats.g.doubleclick.net https://api.stripe.com; font-src 'self'; frame-src 'self' interactive-examples.mdn.mozilla.net interactive-examples.mdn.allizom.net mdn.github.io live-samples.mdn.mozilla.net live-samples.mdn.allizom.net *.mdnplay.dev *.mdnyalp.dev *.play.test.mdn.allizom.net https://v2.scrimba.com https://scrimba.com jsfiddle.net www.youtube-nocookie.com codepen.io survey.alchemer.com https://js.stripe.com; img-src 'self' data: *.githubusercontent.com *.googleusercontent.com *.gravatar.com mozillausercontent.com firefoxusercontent.com profile.stage.mozaws.net profile.accounts.firefox.com developer.mozilla.org mdn.dev interactive-examples.mdn.mozilla.net interactive-examples.mdn.allizom.net wikipedia.org upload.wikimedia.org https://mdn.github.io/shared-assets/ https://mdn.dev/ https://*.google-analytics.com https://*.googletagmanager.com www.gstatic.com; manifest-src 'self'; media-src 'self' archive.org videos.cdn.mozilla.net https://mdn.github.io/shared-assets/; child-src 'self'; worker-src 'self';
x-frame-options: DENY
origin-trial: AxVILwizhbMjxFeHOn1P3R8niO1RJY/smaK4B4d1rLzc1gTaxtXMSaTi+FoigYgCw40uFRDwFcEAeqDR+vVLOW4AAABfeyJvcmlnaW4iOiJodHRwczovL2RldmVsb3Blci5tb3ppbGxhLm9yZyIsImZlYXR1cmUiOiJQcml2YXRlQXR0cmlidXRpb25WMiIsImV4cGlyeSI6MTc0MjA3OTYwMH0=
x-cloud-trace-context: 4042483c8e3a608d60c89742fbd44700
date: Tue, 07 Oct 2025 07:42:05 GMT
server: Google Frontend
via: 1.1 google
vary: Accept-Encoding
content-encoding: gzip
x-cache: miss
inset-block - CSS: カスケーディングスタイルシート | MDN
Toggle sidebar
>
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
inset-block
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2021年4月.
* Some parts of this feature may have varying levels of support.
inset-block
は CSS のプロパティで、要素における論理的なブロック方向の先頭および末尾からの論理的な内部位置を定義し、要素の書字方向やテキストの向きに従って物理的な内部位置に対応付けられます。 top
と bottom
、または right
と left
のいずれかのプロパティに、 writing-mode
, direction
, text-orientation
で定義された値に従って対応します。
このインセットプロパティは、位置指定されていない要素には効果がありません。
試してみましょう
inset-block: 10px 20px;
writing-mode: horizontal-tb;
inset-block: 20px 40px;
writing-mode: vertical-rl;
inset-block: 5% 20%;
writing-mode: horizontal-tb;
inset-block: 1rem auto;
writing-mode: vertical-lr;
<section id="default-example">
<div class="example-container">
<div id="example-element">これは絶対位置指定されています。</div>
<p>
まるで地球の表面から水が引き始めたかのように、通りは泥だらけで、ホルボーン通りを象のようなトカゲのようによちよち歩く、体長 12 メートルほどのメガロサウルスに出会っても不思議ではないでしょう。
</p>
</div>
</section>
.example-container {
border: 0.75em solid #ad1457;
padding: 0.75em;
text-align: left;
position: relative;
width: 100%;
min-height: 200px;
}
#example-element {
background-color: #07136c;
border: 6px solid #ffa000;
color: white;
position: absolute;
inset: 0;
}
構成要素のプロパティ
このプロパティは以下の CSS プロパティの一括指定です。
構文
css
/* <length> 値 */
inset-block: 3px 10px;
inset-block: 2.4em 3em;
inset-block: 10px; /* 値が先頭と末尾の両方に適用される */
inset-block: auto anchor(start);
inset-block: 10em anchor-size(--myAnchor height, 10%);
/* 包含ブロックの幅または高さに対する <percentage> 値 */
inset-block: 10% 5%;
/* キーワード値 */
inset-block: auto;
/* グローバル値 */
inset-block: inherit;
inset-block: initial;
inset-block: revert;
inset-block: revert-layer;
inset-block: unset;
値
inset-block
プロパティは left
プロパティと同じ値を取ります。
公式定義
初期値 | 一括指定の次の各プロパティとして
|
---|---|
適用対象 | 位置指定要素 |
継承 | なし |
パーセント値 | 包含ブロックの論理的な高さ |
計算値 | 一括指定の次の各プロパティとして
|
アニメーションの種類 | length または パーセント値, calc(); |
形式文法
inset-block =
<'top'>{1,2}
<top> =
auto |
<length-percentage> |
<anchor()> |
<anchor-size()>
<length-percentage> =
<length> |
<percentage>
<anchor()> =
anchor( <anchor-name>? &&
<anchor-side> , <length-percentage>? )
<anchor-size()> =
anchor-size( [ <anchor-name> || <anchor-size> ]? , <length-percentage>? )
<anchor-name> =
<dashed-ident>
<anchor-side> =
inside |
outside |
top |
left |
right |
bottom |
start |
end |
self-start |
self-end |
<percentage> |
center
<anchor-size> =
width |
height |
block |
inline |
self-block |
self-inline
例
>ブロック方向の先頭と末尾のオフセットの設定
HTML
html
<div>
<p class="exampleText">テキストの例</p>
</div>
CSS
css
div {
background-color: yellow;
width: 120px;
height: 120px;
}
.exampleText {
writing-mode: vertical-lr;
position: relative;
inset-block: 20px 50px;
background-color: #c8c800;
}
結果
仕様書
Specification |
---|
CSS Logical Properties and Values Level 1> # propdef-inset-block> |
CSS Positioned Layout Module Level 3> # propdef-inset-block> |
ブラウザーの互換性
Loading…
関連情報
- 対応する物理的プロパティ:
top
,right
,bottom
,left
- 対応する物理的な一括指定:
inset
- 対応するインライン方向の一括指定:
inset-inline
writing-mode
,direction
,text-orientation