###前提・実現したいこと
htmlで1枚の画像の上に画像3枚を重ね
上の画像の中央に文字を表示させたい。
###発生している問題・エラーメッセージ
下の画像に中央に出てしまい
うまく上の画像の中央に文字が表示されない
どう、cssに書けばよいのでしょうか?
###該当のソースコード
<!doctype html> <html lang="ja"> <head> <meta charset="utf-8" /> <title>jQuery UI Draggable - Default functionality</title> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.8.3.js"></script> <script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script> <style> html { height: 100%;} body { height: 100%; margin: 0;} #draggable { width: 150px; height: 150px; padding: 0.5em; border-radius: 10px;} #containment-wrapper { width: 100%; min-width:100px; height:100%; min-height:100px; border: 2px solid #ccc; } #droppable { width: 200px; height: 200px; padding: 0; margin: 0; border-style: dashed; border-radius: 10px; text-align: center; } </style> <style type="text/css"> .life { position:absolute; bottom:0%; right:0%; } .attack { position:absolute; bottom:0%; left:0%; } .cost { position:absolute; top:0%; left:0%; } </style> <script> $(function() { $( "#draggable" ).draggable({ cursor: 'move', revert: "invalid", snap: '#droppable', snapMode: 'inner', containment: "#containment-wrapper", scroll: false }); $('#droppable').droppable({ accept: '#draggable', activeClass: 'ui-state-hover', hoverClass: 'ui-state-active', drop: function(event, ui) { $(this).addClass('ui-state-highlight').find('p').text(' '); ui.draggable.draggable("disable", 1); } }); }); </script> </head> <body> <div id="containment-wrapper"> <div id="droppable" class="ui-widget-content"> <p>スナップ</p> </div> <div id="draggable" class="ui-widget-content"> <img src="jpg/cost.jpg" class="cost"><p class="costText">3</p> <img src="jpg/attack.jpg" class="attack"><p class="attackText">2</p> <img src="jpg/life.jpg" class="life"><p class="lifeText">1</p> </div> </div> </body> </html>
###試したこと
###補足情報(言語/FW/ツール等のバージョンなど)