<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Position on qwerty.work</title>
        <link>https://qwerty.work/tags/position/</link>
        <description>Recent content in Position on qwerty.work</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>ja-JP</language>
        <lastBuildDate>Tue, 05 Jul 2022 09:00:08 +0900</lastBuildDate><atom:link href="https://qwerty.work/tags/position/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>【css】position:absoluteで中央揃えする最近の方法</title>
            <link>https://qwerty.work/post/2022/07/css-position-absolute-center/</link>
            <pubDate>Tue, 05 Jul 2022 09:00:08 +0900</pubDate>
            <guid>https://qwerty.work/post/2022/07/css-position-absolute-center/</guid>
            <description>&lt;p&gt;とりあえずメモ。対象の要素を&lt;code&gt;position:absolute;&lt;/code&gt;で左右中央や、上下中央、または上下左右中央に配置する最近のやり方。&lt;/p&gt;&#xA;&lt;h2 id=&#34;positionabsoluteとtransformを使用&#34;&gt;position:absolute;とtransformを使用&#xA;&lt;/h2&gt;&lt;h3 id=&#34;参考ページ&#34;&gt;参考ページ&#xA;&lt;/h3&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://cotodama.co/position-absolute-center/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://cotodama.co/position-absolute-center/&#34; alt=&#34;https://cotodama.co/position-absolute-center/&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://cotodama.co/position-absolute-center/&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://cotodama.co/position-absolute-center/&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://arts-factory.net/position/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://arts-factory.net/position/&#34; alt=&#34;https://arts-factory.net/position/&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://arts-factory.net/position/&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://arts-factory.net/position/&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;h2 id=&#34;positionabsolute以外で中央配置する方法&#34;&gt;position:absolute;以外で中央配置する方法&#xA;&lt;/h2&gt;&lt;h3 id=&#34;参考ページ-1&#34;&gt;参考ページ&#xA;&lt;/h3&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://www.esz.co.jp/blog/2847.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://www.esz.co.jp/blog/2847.html&#34; alt=&#34;https://www.esz.co.jp/blog/2847.html&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://www.esz.co.jp/blog/2847.html&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://www.esz.co.jp/blog/2847.html&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;</description>
        </item><item>
            <title>【CSS】iPhoneのSafariでposition:fixedが効かないときにやったこと</title>
            <link>https://qwerty.work/post/2022/02/safari-fixed-sticky-problem/</link>
            <pubDate>Sun, 13 Feb 2022 20:37:29 +0900</pubDate>
            <guid>https://qwerty.work/post/2022/02/safari-fixed-sticky-problem/</guid>
            <description>&lt;h2 id=&#34;positionfixedが効かない&#34;&gt;position:fixed;が効かない&#xA;&lt;/h2&gt;&lt;p&gt;これはiPhoneに限ったことかもしれませんが、&lt;code&gt;position:fixed;&lt;/code&gt;で**『TOPに戻る』ボタン**を画面スクロールに合わせて追従するように、ブラウザの右下に固定しようとしました。ところが、Windows PCのChromeではちゃんと固定されているのですが、iPhoneのSafariやChromeアプリでは固定されませんでした。そこで解決策メモ。&lt;code&gt;position:sticky;&lt;/code&gt;でも同様みたいです。&lt;/p&gt;&#xA;&lt;h2 id=&#34;ベンダープレフィックスが必要だった&#34;&gt;ベンダープレフィックスが必要だった&#xA;&lt;/h2&gt;&lt;p&gt;解決策は&lt;code&gt;position: -webkit-fixed;&lt;/code&gt;の追加で解決できました。&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-css&#34; data-lang=&#34;css&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;.&lt;span style=&#34;color:#a6e22e&#34;&gt;ScrollTop&lt;/span&gt; {&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;position&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;-webkit-&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;fixed&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;position&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;fixed&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;right&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;bottom&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;; &#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;display&lt;/span&gt;: &lt;span style=&#34;color:#66d9ef&#34;&gt;flex&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;z-index&lt;/span&gt;: &lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;あと、ヒントになった以下のページよると、&lt;code&gt;や&lt;/code&gt;タグでは、&lt;code&gt;display: flex;&lt;/code&gt;または&lt;code&gt;display: block;&lt;/code&gt;も必要みたいです。&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://zenn.dev/tigerr/articles/82fc091cfe69bd&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://zenn.dev/tigerr/articles/82fc091cfe69bd&#34; alt=&#34;https://zenn.dev/tigerr/articles/82fc091cfe69bd&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://zenn.dev/tigerr/articles/82fc091cfe69bd&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://zenn.dev/tigerr/articles/82fc091cfe69bd&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://ecmemo.net/safari-sticky-problem&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://ecmemo.net/safari-sticky-problem&#34; alt=&#34;https://ecmemo.net/safari-sticky-problem&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://ecmemo.net/safari-sticky-problem&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://ecmemo.net/safari-sticky-problem&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;h2 id=&#34;ちなみにお世話になったトップに戻るボタンのサンプル&#34;&gt;ちなみにお世話になった『トップに戻る』ボタンのサンプル&#xA;&lt;/h2&gt;&lt;p&gt;以下のページを参考に、一定のスクロール後に**『TOPに戻る』ボタン**を作成したところ、iPhoneのSafariでボタンが固定されませんでした。このソースに&lt;code&gt;position: -webkit-fixed;&lt;/code&gt;の追加することで解決できました。&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://yuyauver98.me/scroll-show-hide-btn/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://yuyauver98.me/scroll-show-hide-btn/&#34; alt=&#34;https://yuyauver98.me/scroll-show-hide-btn/&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://yuyauver98.me/scroll-show-hide-btn/&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://yuyauver98.me/scroll-show-hide-btn/&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://recooord.org/scroll-to-top/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://recooord.org/scroll-to-top/&#34; alt=&#34;https://recooord.org/scroll-to-top/&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://recooord.org/scroll-to-top/&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://recooord.org/scroll-to-top/&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;</description>
        </item></channel>
</rss>
