Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
<footer>ページの下部に があります。この要素では、いくつか<p>の がフッター内の中央に配置され、ブロック イメージ リンクがfloat: leftフッターの既定の位置に配置されるようにします。フローティング ブロック イメージが、中央揃えのテキストを右に押し出しています。
<footer>
<p>
float: left
<footer>ブロック画像リンクの場所に関係なく、テキストを 内の中央に配置するにはどうすればよいですか?
質問しているうちにわかったのですが…
footer{ position: relative; }
#blocklink { display: inline-block; position: absolute; left: 0; }
テキストは中央に配置されtext-align: center;、ブロック要素は左上隅に配置されます。
text-align: center;