html
1<div class="sample6Wrap"> 2 <div class="sample6">Lorem ipsum dolor sit amet.</div> 3</div>
css
1.sample6Wrap{ 2 width: 300px; 3 height: 300px; 4 background: #ccc; 5 position: relative; 6} 7.sample6{ 8 position: absolute; 9 top: 0; 10 right: 0; 11 bottom: 0; 12 left: 0; 13 margin: auto; 14 width: 100px; 15 height: 100px; 16 background: #888; 17}
これと同じ見た目にhtmlタグ一つでできますか?
意味はないですがそういう方法があれば今後便利だと思ったので質問しました。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/09/21 05:27 編集